Skip to content

Instantly share code, notes, and snippets.

View lewdev's full-sized avatar

Lewis Nakao lewdev

View GitHub Profile
@lewdev
lewdev / floating-logo.html
Created May 1, 2024 00:13
😁 Floating Logo with CSS
<!doctype html>
<head>
<title>😁 Floating Logo with CSS</title>
<style>
.icon-shadow {
width: 50px;
margin-top: 1rem;
box-shadow: 0px 0px 15px 5px #888;
animation: grow 3s ease-in-out infinite;
}
@lewdev
lewdev / #code-minifying-tools-resources.md
Last active September 9, 2024 08:33
🀏 Code Minifying Golfing Tools & Resources
@lewdev
lewdev / #README.md
Last active July 17, 2024 23:14
πŸ”‹ JEX - a Base 72 encoding using URL safe characters

πŸ”‹ JEX - a Base 72 encoding using URL safe characters

I was thinking about storing data in the URL which is probably not a unique idea, but I wanted to see how to implement it myself.

Compression can also be achived by combining two values to indicate repeating values. i.e. 55 = 5,5,5,5,5

Also storing data in URLs, but with a bigger range by converting text to Hex-like values using its character code.

A single character can be a number up to 73 and therefore, two characters can store numbers up to 5329.

URL Safe Special Characters

@lewdev
lewdev / #README.md
Last active May 17, 2025 02:07
🎡🎢 Minimal JavaScript Sound & Music Resources
@lewdev
lewdev / #README.md
Last active May 3, 2024 20:34
πŸ€– Technology Acronym Generator - Letters to Words

πŸ€– Technology Acronym Generator - Letters to Words

After multiple discussions at work and among friends about making acronyms for words, I dug into it to build this minimal Letters to Words Technology Acronym Generator.

Given that you want to create a new acronym with your creative use of letters, you can create an acronym with randomly selected words.

Word list sources: (removed acronyms)

@lewdev
lewdev / #README.md
Last active April 19, 2024 00:52
πŸ‘‰ Clean JSON Inputs & Validate

πŸ‘‰ Clean JSON Inputs & Validate

I keep receiving JSON data with odd characters so I made a small app that corrects all those issues and does an JSON.parse check to see if it passes. Parsing errors will display if any.

πŸ”– Bookmarklet (329b)

data:text/html,<h3>Clean JSON</h3><h5>Input</h5><textarea id=i></textarea><h5>Output</h5><textarea id=o></textarea><p id=err></p><script>i.onchange=_=>{o.value=v=i.value.replace(/[\u000B\u001C\u001D]/g, "").replace(/\u0019/g,"'").replace(/\u0013/g, "-");try{JSON.parse(v);err.innerHTML="Valid"}catch(e){err.innerHTML=e}}</script>

πŸ‘¨β€πŸ’» Clean Version

@lewdev
lewdev / #README.md
Last active November 12, 2024 19:39
πŸš‚ Random Text Generator in a Bookmark (bookmarklet)

πŸš‚ Random Text Generator in a Bookmark (bookmarklet)

Do you need to quickly generate random text?

Use this bookmarklet to quickly gen up some text. This uses words found in the keys of the window object and splits Camel-cased names and removes on at the start and single-character words. Then randomly puts 5-9 words into 5-9 sentences in 5-9 paragraphs.

Object.keys(window).reduce((a,b)=>[...a,...b.split(/^on|(?=[A-Z])/).filter(a=>a.length>1)],[])
@lewdev
lewdev / #README.md
Created March 14, 2024 00:42
β›³ Code Golf: Arrows Solution

β›³ Code Golf: Arrows Solution

https://code.golf/arrows#javascript

p=[0,0]
arguments.map(g=>{[a,b]=[[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1],[0,0],[0,0]]["β†™β†²β‡™β†β‡β‡¦β†–β†°β‡–β†“β‡“β‡©β†‘β‡‘β‡§β†˜β†³β‡˜β†’β‡’β‡¨β†—β†±β‡—β†”β†•β‡”β‡•β₯€β₯".indexOf(g)/3>>0]
p[0]+=a
p[1]+=b
print(p.join` `)})
@lewdev
lewdev / #README.md
Last active February 29, 2024 21:36
β›³ I Code Golfed Somebody Else's Dweet

β›³ I Code Golfed Somebody Else's Dweet

I'm hoping this is interesting to somebody out there that likes code golfing or is interested in knowing what it looks like.

I saw a dweet with a lot of parts that I could add code golf techniques to. I was able to reduce the dweet from 150 to 131 bytes; a 19-byte reduction of code that does the same thing.

I golfed this (150b):

x.font="108pt _";x.fillStyle="#ffffff22";x.fillRect(0,0,1920,1080);x.fillStyle="#000";onmousemove=e=>x.fillText("dwitter",e.offsetX*3.1,e.offsetY*3.1)
@lewdev
lewdev / #README.md
Last active September 23, 2024 01:42
πŸ’€ Dweetegem Hero #helldivers #strategem as a Dweet

πŸ’€ Dweetegem Hero #helldivers #strategem as a Dweet

I love the new Helldivers 2 game and made a Dweet-sized version of Strategem Hero.

a="β¬…β¬†βž‘β¬‡"
t?c.width=99:n=b=0
x.fillText((s=[...Object.keys(this)[n]].map(v=>a[v.charCodeAt()%4]).join``).substr(b),1,9)
onkeyup=e=>a[(e.keyCode-5)%4]==s[b]&&++b>=s.length&&(b=0,n++)