Skip to content

Instantly share code, notes, and snippets.

View lewdev's full-sized avatar

Lewis Nakao lewdev

View GitHub Profile
@lewdev
lewdev / address-bar-code-editor-bookmarklet.md
Last active June 19, 2024 10:09
💻 Address Bar Code Editor Bookmarklet (743b)

💻 Address Bar Code Editor Bookmarklet (845b)

In the latest iteration my code editor, I've made big practical improvements to my bookmarklet HTML code editor. I built ExText which was supposed to be my go-to HTML editor because it displays line numbers, but I realized that it wasn't as useful and I find myself comfortably using the bookmarklet much more frequently.

  • Displays line number, cursor position by column, selected text size, cursor offset, and total length
  • Displays count of highlighted text
  • Favicon that helps distinguish the editor in your tabs
  • Includes a minimal code template:
    <p id=o></p>
@lewdev
lewdev / random-seed-methods.md
Last active June 5, 2024 07:10
🌱 Random Seed Methods

🌱 Random Seed Methods

I wanted to see what's out there and here's what I found.

I think this is decent set to study, but I'm mainly interested in the smallest implementation and not worried about if it's computationally random.

@KilledByAPixel (source)

rand = max => Math.sin(++seed)**2 * 1e9 % max
@lewdev
lewdev / #README.md
Created May 24, 2024 02:23
🎮📃 Download Steam Library List as a CSV (446b)

🎮📃 Download Steam Library List as a CSV (446b)

Visit this URL while logged in your steam account: https://store.steampowered.com/account/licenses/

Copy-paste this code and run in your browser's console

Hit F12, click on the "Console" tab and paste it into the prompt)

a=document.createElement`a`;a.href=URL.createObjectURL(new Blob(["Date,Item,Acquisition Method\n"+[...document.querySelectorAll('.account_table tr &gt; td')].reduce((p,e,i)=&gt;(p[~~(i/3)]=(p[~~(i/3)]||"")+'"'+e.innerHTML.trim().replace(/&lt;\/?[^&gt;]+(&gt;|$)/g,"").replace(/\s+/g," ").replace('"','""').replaceAll(" Remove ","")+'"'+(i%3==2?"":","),p),[]).join`\n`],{type:"text/plain"}));a.click(a.download="steam-games-list.csv");URL.revokeObjectURL(a.href)
@lewdev
lewdev / #README.md
Last active May 15, 2024 19:50
🌌 Punch it Chewie! #StarWars #MillenniumFalcon

🌌 Punch it Chewie! #StarWars #MillenniumFalcon

To celebrate May 4th, I made the cockpit design of the Millennium Falcon fit within a dweet!

🚢 Cockpit of the Millennium Falcon (161b) d/31702

B=~~(t*99)%136
x.save(A=300)
x.translate(960,1080)
x.rotate(B*.035)
@lewdev
lewdev / #README.md
Created May 2, 2024 01:13
👨‍💻 Small CSV Parse & Generate Library

Small Library

I was looking into CSV methods on StackOverflow which didn't have great answers. So I put together some solutions that I'd appreciate.

Here's an answer I made for "JavaScript array to CSV," which didn't have any solid answers.

I found a great solution for parsing CSV so I figured that my work is complete by including a great parseCSV solution I found a while ago by Trevor Dixon.

// Inspired by: https://stackoverflow.com/a/64618766/1675237 & https://stackoverflow.com/a/58034688/1675237
@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 May 10, 2024 02:10
🤏 Code Minifying Golfing Tools & Resources
@lewdev
lewdev / #README.md
Last active May 17, 2024 02:01
🔋 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.

@lewdev
lewdev / #README.md
Last active May 26, 2024 06:43
🎵🎶 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)