Skip to content

Instantly share code, notes, and snippets.

View lewdev's full-sized avatar

Lewis Nakao lewdev

View GitHub Profile
@lewdev
lewdev / #README.md
Last active May 17, 2026 23:41
๐Ÿ’ป Address Bar Code Editor Bookmarklet Part 3 (971b) - Toggle Horizontal-Vertical Views

๐Ÿ’ป Address Bar Code Editor Bookmarklet Part 3 (988b) - Toggle Horizontal-Vertical Views

Initially when I started this project, I wanted to keep it as tiny as possible, which made me hesistant to add more features. But since I started to care about that less, I started to add more features. First it was showing the cursor's line number, column, selected number of characters, and total character count. Then I added a better "dark mode" and now, I enabled the ability to toggle between horizontal and vertical views. This is especially useful on my rotated monitor. On my main set up, my side monitor is rotated to accomodate fitting a large monitor and a smaller one on my monitor stand.

Here's the code. Copy-paste this into your a

@lewdev
lewdev / #README.md
Created April 17, 2026 21:26
๐Ÿ’ป Address Bar Code Editor Bookmarklet Part 2 (876b) - Keeping it dark
@lewdev
lewdev / #README.md
Last active June 21, 2025 17:01
๐Ÿงช JEX Part 3: Two-Color Pixel Editor Exports to JEX Data (each byte stores 3 values) in Sharable URL

๐Ÿงช JEX Part 3: Two-Color Pixel Editor Exports to JEX Data (each byte stores 3 values) in Sharable URL

JEX is a URL friendly Base 69 data storage method I created. JEX is a name that combines the names JavaScript and Hexidecimal.

All JEX characters: ()*+,-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz~

NOTE: I was about to publish the format before realizing that twitter hates single quotes because they force it to be encoded. I really wanted to keep it at 70, I SWEAR!

These characters are all in order by charCodeAt and skips URL unsafe characters: &/:;=? @#<>[]{}|\^%\

@lewdev
lewdev / index.html
Last active April 18, 2026 00:05
๐Ÿ–ฑ๏ธ Mouse Up & Down for Left, Middle, Right, & other clicks
<script>
const showCoord = (eventName, pos, e) => {
o.innerHTML = `${eventName} "${pos}" at x: ${e.x}, y: ${e.y}`;
e.preventDefault()
};
const onMouseEvent = eventName => e => [
e => showCoord(eventName, "Left", e),
e => showCoord(eventName, "Middle", e),
e => showCoord(eventName, "Right", e),
@lewdev
lewdev / index.html
Last active May 26, 2025 20:36
๐Ÿ–ฅ Implementing the Cylinder Trick
<canvas id=c><script>c.width=c.height=1080;x=c.getContext`2d`,F=M=0,onload=U=e=>{requestAnimationFrame(U);if(F&&e<M-2)return;M=Math.max(M+1e3/60,e);T=F/60;if(T*60|0!=F++)T+=1e-6;E(T)};E=t=>{
S=Math.sin;
//Inside a cylinder trick
//https://youtu.be/6XtrgFPoZ2E?si=ucjJgzsH8UVdsH11&t=64
c.width|=0;x.font="2cm'"
x.fillText('โšฝ',0,70)
for(i=70;i--;)for(j=2;j--;)x.drawImage(c,
@lewdev
lewdev / #README.md
Last active April 17, 2026 21:43
๐Ÿ’ฌ Text Diff Highlighter. `highlightDiff` compares 2 strings and displays text that was added & removed

highlightDiff compares two strings and

  • adds a strikethrough attribute to text that was removed and
  • adds a green highlight over the text that was added.

It's very simple solution that works for most situations.

<pre id=o></pre>
@lewdev
lewdev / #README.md
Created February 28, 2025 21:03
๐Ÿ“„ Load Local Text File to HTML Page in JavaScript (+bookmarklet ๐Ÿ”–)

๐Ÿ“„ Load Local Text File to HTML Page in JavaScript (+bookmarklet ๐Ÿ”–)

I wanted to be able to load a text file on a page; specifically, a CSV file for my purposes.

The idea is to load a text file and do some data analysis.

The code uses a built-in browser object FileReader and displays the result. Here's a simple implementation:

@lewdev
lewdev / #README.md
Created November 28, 2024 03:10
๐Ÿ”ผ Turn a webpage into a detab window (no tabs, buttons, bars) as a #bookmarklet

๐Ÿ”ผ Turn a webpage into a detab window (no tabs, buttons, bars) as a #bookmarklet

Save this in a bookmark URL and click on it when you land on the page you want to turn into a clean window.

javascript:window.open(location.href,"detab","toolbar=0");window.close()
@lewdev
lewdev / #README.md
Created October 30, 2024 21:11
๐ŸŽฎ Download CSV of Steam Purchases

๐ŸŽฎ Download CSV of Steam Purchases (473b)

Much like my script to Download Steam Library List, I created a similar script to download your list of Steam Purchases as a CSV file.

It's not perfect because you'll have to filter out the refunds and other types of transactions. Someone on reddit requested me to make it and I figured it was something I wanted to do myself so I did.

๐Ÿช Visit Purchase History Page

Your Purchase History

@lewdev
lewdev / index.html
Last active September 29, 2024 07:36
๐Ÿ‘€ Using `Reflect.ownKeys` to see Class function names in `Math`, `Array`, `Set`, etc.
<table><tbody><tr id=o></tr></tbody></table>
<script>
o.innerHTML = [window, Set, Array, Math, Number, RegExp, Date]
.map(M=>`<td><h3>${M.name || M}</h3><br>${Reflect.ownKeys(M).map(a=>JSON.stringify(a)).join`<br>`}</td>`).join``;
</script>
<style>*{vertical-align:top}