Martin Kleppe Profile Banner
Martin Kleppe Profile
Martin Kleppe

@aemkei

10,412
Followers
435
Following
814
Media
9,399
Statuses

Mapper. Reducer. and creator. @Ubilabs co-founder and @GMapsPlatform GDE. Ex @HHjs and @JSUnconf organizer.

Hamburg
Joined March 2007
Don't wanna be here? Send us removal request.
Pinned Tweet
@aemkei
Martin Kleppe
3 months
My creative JavaScript experiments, quines, hacks and code golf projects: [a thread …]
@aemkei
Martin Kleppe
1 year
Exactly 10 years ago I revealed "WORLD": → A mesmerizing 3D globe encapsulated in its own source code! This #quine is crafted in just 1024 bytes of pure HTML + JavaScript, with no external dependencies. Make sure to view the source!
41
570
4K
4
30
349
@aemkei
Martin Kleppe
3 years
I'm fascinated by this simple formula to create bit fields that look like alien art: (x ^ y) % 9
Tweet media one
125
1K
8K
@aemkei
Martin Kleppe
4 years
The most minimalist creative coding environment is alive: ⟶ Control the size and color of a 16x16 dot matrix with a single JavaScript function. The input is limited to 32 characters – but no limits to your creativity! 🔴🔴 🔴🔴
458
1K
4K
@aemkei
Martin Kleppe
1 year
Exactly 10 years ago I revealed "WORLD": → A mesmerizing 3D globe encapsulated in its own source code! This #quine is crafted in just 1024 bytes of pure HTML + JavaScript, with no external dependencies. Make sure to view the source!
41
570
4K
@aemkei
Martin Kleppe
3 months
Time for a new mind-bending project! #QLOCK — A JavaScript Quine Clock It displays the current time in a seven-segment style, embedded within its own JavaScript source code. 🕔 🕝 🕢 🕤 🕑 🕜 (321 bytes)
59
433
3K
@aemkei
Martin Kleppe
3 years
3️⃣ #Metaballs Quine JS <pre id=p style=background: #000 ><svg onload='setInterval(f=n=>{for(t++,o=i=1;i++<476;o+=i%30?([(f+"")[i%195],"o"][c=0|(h=v=>(M=Math).hypot(i/30-8+3*M.sin(t/8/v),i%30/2-7+4*M.cos(t/9/v)))(7)*h(9)*h(6)/52]||".").fontcolor(c?c>2:n):"\n");p.innerHTML=o},t=1)'>
22
364
2K
@aemkei
Martin Kleppe
7 years
This is by far the best entry of @MaximeEuziere 's #golfctober combo: A full TETRIS game by @veubeke 🐌 in less than 512 bytes of HTML and JavaScript! ▶ Play: ℹ️ Source: With help from @benjamin_js , @Fusselwurm and @aemkei (me).
13
459
944
@aemkei
Martin Kleppe
3 years
THE #MATRIX An animated quine in only 187 bytes of HTML+JS: <body onload='setInterval(f=_=>{for(t++,o=i=0,w=35;i<384;o+=i++%+w?(f+f+f)[i].fontcolor(g==9?" #FFF ":[0,g,0]):"\n")g=0|(i/w-t/((i%w)**5%w+3)+w*t)%w;p.innerHTML=o},t=9)'bgcolor=X><pre id=p> 🐇
12
205
926
@aemkei
Martin Kleppe
7 years
A quick "Talking Face" #JS doodle in < 100 characters: setInterval(_=>{ document.body.innerHTML = "<h1>" + [ ..."😮😀😁😐😑😬" ][new Date%6] }, 99) Demo:
13
245
836
@aemkei
Martin Kleppe
4 years
// #HIEROGLYPHS .js // Valid JavaScript from the year 2020 BC: 𓅂='',𓂀=!𓅂+𓅂,𓁄=!𓂀+𓅂,𓊎=𓅂+{},𓆣=𓂀 [𓅂++],𓊝=𓂀[𓇎=𓅂],𓏢=++𓇎+𓅂,𓆗=𓊎[𓇎+𓏢 ],𓂀[𓆗+=𓊎[𓅂]+(𓂀.𓁄+𓊎)[𓅂]+𓁄[𓏢]+𓆣+ 𓊝+𓂀[𓇎]+𓆗+𓆣+𓊎[𓅂]+𓊝][𓆗](𓁄[𓅂]+𓁄[ 𓇎]+𓂀[𓏢]+𓊝+𓆣+'`𓅂 𓏢 𓂀 𓁄 𓆣 𓊝 𓇎`')``
Tweet media one
16
313
833
@aemkei
Martin Kleppe
7 years
for(z=[i=991];i--;)z[i]=i%30?8:"\n";F=d=>[30,1,-30,-1].map((f,g,h)=>" "<z[f=d+2*h[3&g+i]]&&(z[f]=z[(d+f)/2]=" ",i+=7,F(f))),F(32),z+"🌽 𝐌𝐀𝐙𝐄"
Tweet media one
17
241
630
@aemkei
Martin Kleppe
3 years
This is just beautiful! ((x-128) * 64) % (y-128)
Tweet media one
13
56
511
@aemkei
Martin Kleppe
4 years
The talking favicon in 256 bytes: Source: <link rel=icon id=i> <body onload="setInterval(_=>i.href=`data:image/svg+xml,<svg xmlns=%27 http://www.w3.org/2000/svg' viewBox='0 0 16 16'><text y='16'>${[...'😮😀😁😐😑😬'][++x%6]}</text></svg>`,x=9)">
13
119
492
@aemkei
Martin Kleppe
5 years
Evil note: In JavaScript you can replace some Latin characters with their Cyrillic doppelgänger ("aceijopsxy" => "асеіјорѕху") to use reserved words as your variable names such as: var vаr = function functіon(functіon){ cаtch = "me"; іf [you = "can"]; } vаr (breаk = true);
27
124
495
@aemkei
Martin Kleppe
3 years
More examples: (x ^ y) % 5 (x ^ y) % 17 (x ^ y) % 33 (inspired by )
Tweet media one
Tweet media two
Tweet media three
@theFoldster
Foldster
4 years
#genuary2021 Jan 5: Code Golf! Work a Day 12/365: Bitfield 1 Python Code: from PIL import Image import numpy as np r = range(512) x, y = np.meshgrid(r, r) i = (1 == (abs(x+y)^abs(x-y)+1)**37 % 7) * 255 Image.fromarray(i).convert('L').save('1.png')
Tweet media one
4
38
252
6
47
483
@aemkei
Martin Kleppe
3 years
Source: <canvas id="c" width="1024" height="1024"> <script> const context = c.getContext('2d'); for (let x = 0; x < 256; x++) { for (let y = 0; y < 256; y++) { if ((x ^ y) % 9) { context.fillRect(x*4, y*4, 4, 4); } } } </script>
5
30
465
@aemkei
Martin Kleppe
3 years
If we use OR instead of XOR, we get some nice Sierpinski triangles: (x | y) % 7 (x | y) % 17 (x | y) % 29
Tweet media one
Tweet media two
Tweet media three
7
29
411
@aemkei
Martin Kleppe
7 years
// #the_invisble_alert ([,ᅠ,,,,ᅠᅠ]=[]+{},[ᅠᅠᅠ,ᅠ‌,ᅠᅠᅠᅠ,ᅠᅠ‌,,ᅠᅠᅠᅠᅠ,ᅠᅠᅠ‌,ᅠᅠᅠᅠᅠᅠ,,,ᅠᅠᅠᅠ‌]=[!!ᅠ]+!ᅠ+ᅠ.ᅠ) [ᅠᅠ+=ᅠ+ᅠᅠᅠᅠ‌+ᅠᅠᅠᅠᅠᅠ+ᅠᅠᅠ+ᅠ‌+ᅠᅠᅠᅠ+ᅠᅠ+ᅠᅠᅠ+ᅠ+ᅠ‌][ᅠᅠ] (ᅠᅠᅠᅠᅠ+ᅠᅠᅠ‌+ᅠᅠ‌+ᅠ‌+ᅠᅠᅠ+'` #JS !`')``
Tweet media one
12
182
384
@aemkei
Martin Kleppe
5 years
Buginese is a language spoken by five million people in the southern part of Sulawesi Indonesia. They use the Lontara script which characters look super interesting and are valid #JavaScript variable names. Here is an `alert(1)` with this writing system:
Tweet media one
15
209
356
@aemkei
Martin Kleppe
3 years
“No preciso erigir un laberinto, cuando el universo ya lo es.” ― Jorge Luis Borges This is one of my favorite quotes and roughly translates into: “There is no need to build a labyrinth when the entire universe is one.” So I turned it into a typo maze:
Tweet media one
10
95
366
@aemkei
Martin Kleppe
3 years
Some great examples of the "Annual Computer Art Contest" published in the "Computers and Automation" magazine since 1963. IN WILDERNESS — Lloyd Sumner
Tweet media one
9
52
351
@aemkei
Martin Kleppe
7 years
OMG: @kinugawamasato and @SylvainPV found a way to use only 5 different characters to write any JavaScript: [ ] + | > Note: This will possibly work in the future by default, if the ESNext "Pipeline Operator" |> proposal will make it. Read more:
Tweet media one
@SylvainPV
Sylvain Pollet-Villard
7 years
Confirmed: The #javascript Wall of 6 has fallen with pipeline operator -tc39 stage 1 proposal) Working compiler:
3
24
46
19
164
324
@aemkei
Martin Kleppe
1 year
I love to see being used in the wild — even if it was never my intention to create a library for XSS. This bypass was reported to the Expedia Group Bug Bounty program in December 2021 and was fixed in April 2023.
Tweet media one
@bxmbn
🇪🇨🍫
1 year
New Disclosed Report
4
6
73
4
63
313
@aemkei
Martin Kleppe
5 years
$five =$+[] After many years of heavy research we finally found a solution to write JavaScript with only 5 different symbols: $+=[] ⟶ Hint: This solution targets some internals of jQuery UI — which is still being used by more than 10% of all websites.
7
131
318
@aemkei
Martin Kleppe
5 years
[sic] – Encode JS with 2 different symbols only ⟶ A super tiny library to inject self-executing JavaScript code. The obfuscated code contains nothing but a sequence of square brackets! [][[][[]]][[]][[]][[][[]]][[][[]]][[][[]]][[][[]]][[]][…
10
92
286
@aemkei
Martin Kleppe
3 years
Beams: (x * 2) % y (x * 64) % y (x * 31) % y
Tweet media one
Tweet media two
Tweet media three
3
16
271
@aemkei
Martin Kleppe
8 years
// VOID A quine that hides JavaScript using zero-width variables and invisible code. ( #worksbestonchrome )
4
143
257
@aemkei
Martin Kleppe
3 years
HOT CODE A JavaScript Quine in 203 Bytes → <body bgcolor=🔥 onload=setInterval(e='for(h=``,a[I++*I%17+578]=i=89;i++<630;h+=i%30?(x=a[i]=~~((a[i]+a[i+1]+a[i+29]+a[i+30])/4))&&e[i%142].fontcolor(5<x&&" #FF0 "):"\\n")p.innerHTML=h',a=[I=30])><pre id=p>
2
34
243
@aemkei
Martin Kleppe
3 years
The "Sidewinder" algorithm is one of the easiest way to draw a "perfect" maze with no loops and no isolation: Randomly carve a couple of cells to the right. Then go back and choose one of the last cells and carve to the top. Proceed until the end of a row and go to the next. …
9
44
242
@aemkei
Martin Kleppe
4 years
This is an even more minimalist coding environment:: ⤑ Enter a (t,i,x,y) function after the URL hash and it will render the animated output to the browser's favicon. 🧑‍💻 (desktop only!)
3
30
238
@aemkei
Martin Kleppe
4 years
Here is a nice little hack to hide code inside a #BigInt . The idea is use octal escape sequences and replace the backslash \ with the digit 9. // the encoded `alert(1)` x = 91419154914591629164950961951n; // the decoder [`'${x}'`.replace(/9/g, "\\")].map(eval).map(eval)
Tweet media one
5
64
224
@aemkei
Martin Kleppe
3 years
~ F L U I D ~ ~~~~~~~~~ A HTML, canvas and JavaScript quine in 988 bytes. ~> The "FLUID" page animates its own source code, where each character is a water particle that drips down with basic physics applied. 💦
2
36
230
@aemkei
Martin Kleppe
4 years
There are four ways to evaluate JavaScript code represented as a string: const CODE = 'alert(1)'; 1⃣ eval(CODE) 2⃣ Function(CODE)()() 3⃣ setTimeout(CODE) 4⃣ document.write('<script>'+CODE+'</script>') And variations such as setInterval, innerHTML, … Did I miss anything here?
Tweet media one
17
70
224
@aemkei
Martin Kleppe
3 years
Combing pixel typography with labyrinthic lines will create some confusing op art. I wonder if anyone can read this:
Tweet media one
23
22
211
@aemkei
Martin Kleppe
3 years
Circular patterns: (x * y) & 64 (x * y) & 24 (x * y) & 47
Tweet media one
Tweet media two
Tweet media three
6
12
207
@aemkei
Martin Kleppe
4 years
There is so much to learn about HTML and JS hacks from this code: <svg/onload=throw/**/Uncaught=window.onerror=eval,";alert\501\51"> This is inspired by @garethheyes and will execute an 'alert(1)' without using parentheses, spaces or quotes!
Tweet media one
3
75
196
@aemkei
Martin Kleppe
7 years
Here are the slides of my talk "Daedalus – Though the Maze of Code" at @jsconfis about creative coding and code golfing in JavaScript. Thanks all for listening – it was fun! (Hint: Download the PDF, because it contains links to all examples.)
8
54
202
@aemkei
Martin Kleppe
4 years
I always love when people break all the rules (eg, the character limit of )! // super mario // by @sosowski
4
26
175
@aemkei
Martin Kleppe
7 years
.xXXx. The final stage of my two-faced experiments: A working example (aka "alert") written with symmetric code!
Tweet media one
14
69
171
@aemkei
Martin Kleppe
8 years
Releasing… /// AUREBESH.js → Translate JavaScript to other writing systems! # ΔYロIᗐコΞ 👾
6
73
174
@aemkei
Martin Kleppe
8 years
Dwitter – the "social network for short JS demos" – looks like the perfect mix of @140bytes and @Shadertoy :
Tweet media one
5
76
168
@aemkei
Martin Kleppe
8 years
FÌRE An ASCII art fire animation in ~128 bytes of JavaScript: → 🔥 #hot
3
97
164
@aemkei
Martin Kleppe
4 years
I'm excited to release "🌍" — the smallest possible 3D globe in just 75 characters! (t,i,x,y) => '灾擾ϿǾǾῼ羼߰́ࠇ㰇繿ǿÿဎ'.charCodeAt(5*(t-acos((1-x/8)/cos(asin(1-y/8))))%19)&2**y It includes encoded bitmap data and results in just 98 bytes of JavaScript.
2
19
160
@aemkei
Martin Kleppe
4 years
You can now skip `Math.` in your code and access functions and props like `sin` and `PI` directly! This gives you x*5 more space for your art. I'm impressed by the overwhelming feedback. got 2500 likes, 1000 retweets and 250 replies in less than 24 hours.
12
17
159
@aemkei
Martin Kleppe
6 years
# enter the matrix node -e 'setInterval(_=>{for(Y=y,x=80;x-=2;){Y=(Y+x*x+9)%27;p(x,Y,(X="\\u001B[")+`37m${C=String.fromCharCode(12450+(y*x)%16)}`);for(o=6;--o;)p(x,Y-o,X+`38;5;${46-(o*6)}m${C}`)}y++},y=99,p=(x,y,c)=>y<22&&console.log(X+`40m${X}${y};${x}H${c}`))'
6
37
160
@aemkei
Martin Kleppe
4 years
News from ! We all won the 2020 election and celebrate this with the smallest possible Star-Spangled Banner: // us flag // in 32 bytes (t,i,x,y) => x>6|y>5?y<12&&sin(y+t+i*6):.3 🇺🇸
5
24
150
@aemkei
Martin Kleppe
6 years
Assigning numeric values to Hebrew letters in JavaScript looks different than expected… const א = 1; // one const ב = 2; // two const ג = 3; // three const ד = 4; // four const ה = 5; // five const ו = 6; // six const ז = 7; // seven const ח = 8; // eight
Tweet media one
4
48
147
@aemkei
Martin Kleppe
5 years
The slides for my talk "The Art of Obfuscation" at @FrontCon Riga are up here: Thanks to the great audience and all the positive feedback!
8
35
145
@aemkei
Martin Kleppe
8 years
I love these spinners by @sindresorhus : Very minimalistic and perfect for your Node.js CLI projects.
1
48
130
@aemkei
Martin Kleppe
5 years
36 months …
Tweet media one
3
2
131
@aemkei
Martin Kleppe
6 years
assert.equal( ['🍞', '✊', '🥚', '🌎', '🐖', '🐄', '🎱'].flatten(), ['🥪', '🤚', '🍳', '🗺', '🥓', '🥩', '🕳️'] 'Hope my test still works ...' );
2
45
129
@aemkei
Martin Kleppe
3 years
An animated ASCII art with three animated metaballs that reveal the underlying JavaScript source code. All done in 256 bytes that fit into a tweet. Demo: (Make sure to view the source!)
7
17
125
@aemkei
Martin Kleppe
4 years
Here are some of my b/w creations at // scrolling "TIXY" font // by @atesgoral (t,i,x,y) => [5463,2194,2386][y+t*9&7]&1<<x-1
9
8
124
@aemkei
Martin Kleppe
3 years
🟦🟩🟨🟧🟥🟪🟦🟩🟨🟧🟥 🟩🟨🟧🟥🟪🟦🟩🟨🟧🟥🟪 🟨🟧🟥🟪🟦🟩🟨🟧🟥🟪🟦 🟧🟥🟪🟦🟩🟨🟧🟥🟪🟦🟩 🟥🟪🟦🟩🟨🟧🟥🟪🟦🟩🟨 🟪🟦🟩🟨🟧🟥🟪🟦🟩🟨🟧 🟦🟩🟨🟧🟥🟪🟦🟩🟨🟧🟥 🟩🟨🟧🟥🟪🟦🟩🟨🟧🟥🟪 🟨🟧🟥🟪🟦🟩🟨🟧🟥🟪🟦 🟧🟥🟪🟦🟩🟨🟧🟥🟪🟦🟩 🟥🟪🟦🟩🟨🟧🟥🟪🟦🟩🟨 // drawing by numbers 🌈🧵
8
20
125
@aemkei
Martin Kleppe
8 years
Releasing… ==== A polyglot inception written in four file formats – all at the same time: = JPEG = CSS = JS = HTML
5
76
118
@aemkei
Martin Kleppe
3 years
Steps: (x ^ y) < 77 (x ^ y) < 214 (x ^ y) < 120
Tweet media one
Tweet media two
Tweet media three
5
3
120
@aemkei
Martin Kleppe
5 years
THE FINAL STEP: ꝏ - Encode JavaScript with only one symbol! The code only contains a (VERY!) long sequence of the character `o`. The length is then 1. converted to binary … 2. split into 7-bit groups … 3. encoded as ASCII text … 4. and evaluated.
6
34
119
@aemkei
Martin Kleppe
3 years
An ancient alert(1) from 1337 BC was just discovered on Crete: 𐂃='',𐃨=!𐂃+𐂃,𐂝=!𐃨+𐂃,𐃌=𐂃+{},𐁉=𐃨[𐂃++],𐃵=𐃨[𐂓=𐂃],𐀜=++𐂓+𐂃,𐂠=𐃌[𐂓+𐀜],𐃨[𐂠+=𐃌[𐂃]+(𐃨.𐂝+𐃌)[𐂃]+𐂝[𐀜]+𐁉+𐃵+𐃨[𐂓]+𐂠+𐁉+𐃌[𐂃]+𐃵][𐂠](𐂝[𐂃]+𐂝[𐂓]+𐃨[𐀜]+𐃵+𐁉+"(𐂃)")()
Tweet media one
3
27
117
@aemkei
Martin Kleppe
3 years
187 bytes ASCII Meta Balls Full Source (HTML + JS): <pre id=p><svg onload='setInterval(n=>{for(o=t++,i=480;i--;p.innerHTML=o)o+=i%30?"#+"[0|(h=o=>Math.hypot(i/30-8+3*Math.sin(t/8/o),i%30/2-7+4*Math.cos(t/9/o)))(9)*h(8)/9]||" ":"\n"},t=1)'>
2
8
118
@aemkei
Martin Kleppe
4 years
This is how JavaScript looks when written with Cuneiform: 𒁰='',𒀰=!𒁰+𒁰,𒁃=!𒀰+𒁰,𒅋=𒁰+{},𒄦=𒀰[𒁰++],𒄡=𒀰[𒃺=𒁰],𒂞=++𒃺+𒁰,𒆟=𒅋[𒃺+𒂞],𒀰[𒆟+=𒅋[𒁰]+(𒀰.𒁃+𒅋)[𒁰]+𒁃[𒂞]+𒄦+𒄡+𒀰[𒃺]+𒆟+𒄦+𒅋[𒁰]+𒄡][𒆟](𒁃[𒁰]+𒁃[𒃺]+𒀰[𒂞]+𒄡+𒄦+"`𒁃𒅋𒃺𒂞`")``
5
31
111
@aemkei
Martin Kleppe
4 years
The Hangul Filler (U+3164) is an invisible but valid JavaScript identifier. It can be used for variable names, parameter, functions, arguments, and object properties. // INVISIBLES … ᅠᅠ =ᅠ=> alert(ᅠ.ᅠ); ᅠ ({ᅠ: 1}) Demo:
Tweet media one
4
64
115
@aemkei
Martin Kleppe
3 years
#JS #HACK #42 🙈 =============== You only need 42 bytes and a (long) URL to render any web page you like! …#[ENCODED_SCRIPT] Make sure to view the source code in this demo and read the following thread.
8
24
116
@aemkei
Martin Kleppe
4 years
Five different ways in JavaScript to execute a function. function x(y) { alert(y); } 1⃣ x(1); // implicit invocation 2⃣ x`1`; // tagged template literals 3⃣ new x; // constructor 4⃣ ({toString: x}) + ""; // type conversion 5⃣ onerror=x; throw 1; // handle event
Tweet media one
7
56
113
@aemkei
Martin Kleppe
6 years
Hery is a tiny slot machine in in 119 bytes of JavaScript: c.width=500;x.font='9em"'for(i=3;i--;x.fillText(T[0]+T[1]+T[2],40,200))t%6<i+2?T[i]=[...'💰🔔🍒🍌🍉'][(i*t+9*t|0)%5]:S @dwitter_net
2
28
108
@aemkei
Martin Kleppe
4 years
Well, this is a nice way to obfuscate and execute an 'alert(1)' in JavaScript: Function`$${atob`YWxlcnQoMSk=`}``` It uses a mix of … - the function constructor - tagged template literals - lesser-known decoder "atob" Evil work by @BitK_ 🦹
7
20
110
@aemkei
Martin Kleppe
4 years
Some basic hints: 1. Click the dots to get detailed instructions. 2. Update the code to create your own animations. 3. Hit "submit" to save the code in the URL. 4. Make sure to share your creations in the comments! I will pick the best and add them to the default examples.💕
51
8
109
@aemkei
Martin Kleppe
3 years
Checker: (x ^ y) & 32 (x ^ y) & 72 (x ^ y) & 23
Tweet media one
Tweet media two
Tweet media three
2
2
106
@aemkei
Martin Kleppe
3 years
Having fun drawing tweets using JavaScript and Unicode colors! 🟦 🟩 🟨 🟧 🟥 🟪 Here are my favourites: 1️⃣ (x * y) % 10 - 1 2️⃣ (x ^ y) / 2 3️⃣ 12 - (x + y) 4️⃣ x * y >> 4
Tweet media one
Tweet media two
Tweet media three
Tweet media four
@aemkei
Martin Kleppe
3 years
const colors = [...'🟦🟩🟨🟧🟥🟪']; let output = ''; for (let y = 0; y < 11; y++) { for (let x = 0; x < 11; x++) { let v = (x + y) % 6; let color = colors[v]; output += color || '⬛'; } output += '\n'; } //
2
5
21
8
18
108
@aemkei
Martin Kleppe
6 years
// 165 bytes // HTML+JS // Game of Life <body onload=b=!setInterval`for(a=b,b=h=[i=999];i--;_.innerText=h+="▁▉-"[i%47?b[i]=a?d==3|a[i]&d==2:24*i%7%2:2])for(d=0,j=5;e=(2<j--)*44+j;)d+=a[i+e]+a[i-e]` id=_> // // based on
3
33
108
@aemkei
Martin Kleppe
4 years
A collection of colorful examples from : // sin cos sin cos sin cos // by @inky (t,i,x,y)=> ((x^y)%2?sin:cos)(t)
4
11
105
@aemkei
Martin Kleppe
4 years
I've ported to pure Node.js! You can now render the examples in the command line as beautiful #ASCII art: > npx tixy-land "sin(t-sqrt((x-7.5)**2+(y-6)**2))"
4
11
106
@aemkei
Martin Kleppe
4 years
41 Bytes ▲ Sierpiński Triangle in JavaScript: for(o=i=2011;i--;)o+=i%63?i&i/32&&'_':` ` Golfed by @p01 , @MaximeEuziere , @justecorruptio , @subzey , me, et al. #fractal
Tweet media one
Tweet media two
4
27
103
@aemkei
Martin Kleppe
3 years
Noise: ((x * y) ** 4) % 7 ((x * y) ** 5) % 99 ((x * y) ** 9) % 3
Tweet media one
Tweet media two
Tweet media three
2
7
103
@aemkei
Martin Kleppe
4 years
After doing some research, I came across this beautiful JavaScript poem (aka Source Code Poetry) by Andrew Longstaff:
Tweet media one
3
28
98
@aemkei
Martin Kleppe
7 years
#THESEUS Creating and solving a maze in only 256 bytes of JavaScript. → Based on Claud Shannon's early machine-learning work from 1952.
1
29
98
@aemkei
Martin Kleppe
3 years
Some unique and exotic ways to get "undefined" in JavaScript by just using basic types: - Array: [][[]] - String: ""[""] - Function: ($=>$)() - Object: ({}).$ - Number: 0.0.$ - RegExp: /$/.$ - Boolean: false.true
Tweet media one
12
17
97
@aemkei
Martin Kleppe
4 years
It is the end of 2020 so I made a super small #PONG game in just 90 bytes: (t,i,x,y)=> 1>hypot(a=(B=(_,o)=>_-((r=o*t%32)<16?r:32-r))(x,9),b=B(y,5))|(!x|14<x)&abs(b+3*sin(a/3))<2 I will explain the basic concepts in the following thread … (1/9)
2
26
95
@aemkei
Martin Kleppe
7 years
([,ウ,,,,ア]=[]+{},[ネ,ホ,ヌ,セ,,ミ,ハ,ヘ,,,ナ]=[!!ウ]+!ウ+ウ.ウ)[ツ=ア+ウ+ナ+ヘ+ネ+ホ+ヌ+ア+ネ+ウ+ホ][ツ](ミ+ハ+セ+ホ+ネ+'(-~ウ)')() // #100chars
Tweet media one
2
46
93
@aemkei
Martin Kleppe
8 years
~ ~ A minimalistic LORENZ ATTRACTOR in only 112 bytes of HTML and JavaScript !
5
50
92
@aemkei
Martin Kleppe
3 years
Here is a little pixel art editor to draw Tweets with Unicode colors: // source: for(x=132;x--;c="⬜")document.write(`<b onclick='${x>10?"innerText=c'>⬛":`c="${i=[..."⬛⬜🟦🟩🟨🟧🟥🟪🟫"][x]}"'>${i||""}`}</b>${x%11?"":"<br>"}`)
Tweet media one
8
19
92
@aemkei
Martin Kleppe
4 years
Nine different ways to write 42 in JavaScript: [ 42, // integer 42.0, // float 42e0, // with exponent 4_2, // with numeric separator 052, // octal (old way) 0o52, // octal (new way) 0b101010, // binary 0x2A, // hexadecimal 42n // as BigInt ]
12
33
90
@aemkei
Martin Kleppe
4 years
4 years. The time flies. 🕐🕑🕒🕓
Tweet media one
11
4
90
@aemkei
Martin Kleppe
9 months
// un-sorted
3
9
91
@aemkei
Martin Kleppe
5 years
Hello WORLD Hello LINO Hello #2
Tweet media one
18
0
84
@aemkei
Martin Kleppe
3 years
Drawing a labyrinth (aka "unicursal maze") is easier than expected: Just take a regular maze and add walls bisecting each passage. This will turn each dead end into a U-turn passageway. The new unicursal maze will have twice the dimensions of the original maze it was based on.
6
8
83
@aemkei
Martin Kleppe
7 years
Everything you always wanted to do with brackets: ({[{}]([]){}}[{}])([]) expression,call,member,object,property,func,param,array,block,arg
Tweet media one
5
37
84
@aemkei
Martin Kleppe
3 years
⏩ 60 months
1
4
84
@aemkei
Martin Kleppe
7 years
One of the (super rare) breaking changes in JS: this.a=0; let=[]; let[a]=[1]; console.log(a, let); // ES5: 0, [[1]] // ES6: 1, []
Tweet media one
3
43
81
@aemkei
Martin Kleppe
4 years
Taking invisible code to the next level: // alert("🕵"); [ᅠ,ᅠ︀,ᅠ︁] = [escape, unescape, eval]; [ᅠ`󠁡󠁬󠁥󠁲󠁴󠀨󠀢󠁉󠀧󠁭󠀠󠁴󠁨󠁥󠀠󠁩󠁮󠁶󠁩󠁳󠁩󠁢󠁬󠁥󠀠󠁭󠁡󠁮󠀡󠀠󠁜󠁵󠁄󠀸󠀳󠁄󠁜󠁵󠁄󠁄󠀷󠀵󠀢󠀩`.replace(/u.{8}/g,``)].map(ᅠ︀).map(ᅠ︁);
Tweet media one
2
19
82
@aemkei
Martin Kleppe
3 years
A beautiful black/white painting with only 128 characters.
@KilledByAPixel
Frank Force 🌻
3 years
11 bytes smaller thanks to amazing work by tomxor! for(X=t?X+r*50:0,i=h=11+6*C(t*4+X%1)<<5;--i;x.fillRect(...t?[X-r*i/4,600+(r*8&3?i-h:h-i),i/4,2]:[i*8,r*999,h,r]))r=Math.random()
Tweet media one
4
25
157
2
10
82
@aemkei
Martin Kleppe
3 years
You can also combine different patterns: (x & y) & (x ^ y) % 19 ((x ^ y) & 32) * (x ^ y) % 9) (x * 64) % y * ((x ^ y) < 77)
Tweet media one
Tweet media two
Tweet media three
4
1
82
@aemkei
Martin Kleppe
7 years
A MAZE IS A MAZE → Copy and paste the labyrinthic code to your JavaScript console and it will generate a new maze!
3
27
81
@aemkei
Martin Kleppe
8 years
🦁🦁🦁 Here be lions: Make sure to view the source code! A quick sketch to hide code in invisible characters.
Tweet media one
4
48
79
@aemkei
Martin Kleppe
4 years
I'm scared! const ᐸscriptᅠtypeꘌˮtextⳆjavascriptˮᅠⳆᐳ = ' #OMG '; console.log(ᐸscriptᅠtypeꘌˮtextⳆjavascriptˮᅠⳆᐳ); // #OMG --- It uses Unicode confusables in the variable name to make it look like HTML. Demo:
Tweet media one
2
13
75
@aemkei
Martin Kleppe
3 years
Mona Lisa in a tweet! Exactly 280 bytes for a 64x64 version of the world's most famous painting – compressed using the WebP image format. The following tweet shows the source …
Tweet media one
Tweet media two
6
8
70
@aemkei
Martin Kleppe
7 years
JStillery by @WisecWisec is an advanced tool to deobfuscation JavaScript via partial evaluation. Here is a demo that will make JSFuck a bit more readable:
Tweet media one
4
32
71
@aemkei
Martin Kleppe
7 years
Here are all the 42 symmetric JS expressions returning number 1 with a base length < 10: ()[]{}\/<> *^+=|~-:!.'"
Tweet media one
4
36
71
@aemkei
Martin Kleppe
7 years
@MaximeEuziere @p01 setInterval(_=>{for(H="<svg>",t+=.01,i=h=400;i--;)Math.cos(t-i)>0&&'榁˜翻꺿듻ퟝ믭󫥤큰삗⢠挎ᩐ肦䰠椉䠊ᑒꊐࢀင'.charCodeAt(i/16)>>i%16&1&&(H+=`<text x=${70+(i*h-i*i)**.5*Math.sin(t-i)/3} y=${9+i/3}>+</text>`);document.body.innerHTML=H},t=9) // #HELLO_WORLD in a tweet
2
31
70
@aemkei
Martin Kleppe
3 years
LABYRINTH — Frieder Nake
Tweet media one
3
8
70
@aemkei
Martin Kleppe
7 years
Three types of (pseudo) randomness: 1) Math.random()*W 2) Math.cos(++I*I)*W 3) ++J**5%W #js #codegolf
Tweet media one
4
19
69