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 October 22, 2023 08:27
🕹 Tiny Best Set Go List

🕹 Tiny Best Set Go Game List

Info on each game:

  • Name
  • Platform
  • Set (32GB, 64GB, 128GB)
  • Parenthesis - info in the parenthesis of the title

I want to create a table view where you could text search and filter by platform.

@lewdev
lewdev / konami-code.html
Last active June 27, 2023 21:10
⌨️ Do the Konami Code!
<h1>⌨️ Do the Konami Code!</h1>
<script>
// https://jamiebuilds.github.io/tinykeys/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).tinykeys={})}(this,function(e){var t=["Shift","Meta","Alt","Control"],n="object"==typeof navigator?navigator.platform:"",i=/Mac|iPod|iPhone|iPad/.test(n),o=i?"Meta":"Control",r="Win32"===n?["Control","Alt"]:i?["Alt"]:[];function a(e,t){return"function"==typeof e.getModifierState&&(e.getModifierState(t)||r.includes(t)&&e.getModifierState("AltGraph"))}function f(e){return e.trim().split(" ").map(function(e){var t=e.split(/\b\+/),n=t.pop();return[t=t.map(function(e){return"$mod"===e?o:e}),n]})}function u(e,n){var i;void 0===n&&(n={});var o=null!=(i=n.timeout)?i:1e3,r=Object.keys(e).map(function(t){return[f(t),e[t]]}),u=new Map,d=null;return function(e){e instanceof KeyboardEvent&&(r.forEach(function(n){var i=n[0],o=n[1],r=u.get(i)||i;!function(e,n){return!(n[1].toUpperCase()!==e.ke
@lewdev
lewdev / #README.md
Last active November 30, 2023 23:42
🔎 Search MUI v5 Icons

🔍 Material UI v5 Icon Search

📱 View app here

I was getting tired of how slow this page was material-ui.com/components/material-icons/ so I made my own. Using the debugger, I found the SVG and keyword association data.

The page is already massive with all of that SVG and text data and then it includes a menu and other stuff.

99% of the time, I'm visiting this page to do one thing and that is to search for icons and the dark mode doesn't always turn on and the search is oddly broken sometimes. Maybe it's just a Firefox thing, but whatever the case, I'm solving this problem on my own.

@lewdev
lewdev / #alarm-clock-bookmarklet.md
Last active June 9, 2023 02:05
⏲ Alarm Clock in 25 lines and bookmarklet

⏲ Alarm Clock Bookmarklet (584b)

This tiny app displays a clock and a dropdown of the hour and minute for the alarm time. The borderless input field is there so you can add the purpose of the alarm.

When the hour and time match, the text will flash red and beeping will persist until the hour and minute no longer match the dropdown values.

data:text/html,Alarm<select id=h></select>:<select id=m></select> <input style=border:0><body onload='p=u=>(u>9?"":"0")+u;b=_=>{d=new AudioContext;l=d.createOscillator();l.frequency.value=800;l.connect(d.destination);l.start();setTimeout(()=>l.stop(),500)};u=n=>Array(n).fill().map((_,i)=>`<option>${p(i)}</option>`).join``;h.innerHTML=u(24);m.innerHTML=u(60);setInterval(()=>{d=new Date;a=[H,M,S]=[d.getHours(),d.getMinutes(),d.getSeconds()].map(p);e=H===h.value&&M===m.value;if(e)b();o.style.color=(e&&S%2?"red":"");o.innerHTML=a.join`:`;},1000)'><center id=o style=font:25vw/90vh'>

In this bookmarklet, I was able to put all code into the onload in the `` tag

@lewdev
lewdev / index.html
Last active July 5, 2023 22:56
🌏 Lost Planet 2 Quick Reference Guide
<!doctype html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Lost Planet 2 Quick Guide</title>
<meta name="author" content="Lewis Nakao">
<meta name="description" content="Helpful list to IGN guide, YouTube videos, Cheats, Abilities, and Weapons.">
<meta name="keywords" content="Lost Planet 2, Walkthrough, Game Guide, Links, YouTube Videos">
@lewdev
lewdev / lost-planet-2-ep-ch-links.md
Last active June 1, 2023 11:36
🌏 Lost Planet 2 Episodes & Chapters IGN Walkthrough Guide Links
@lewdev
lewdev / ps1-games-list.md
Last active January 28, 2026 07:33
🎮 Top Recommended PS1 Games list
@lewdev
lewdev / array-shuffling.html
Last active October 17, 2025 05:51
🔢 Array Shuffling Methods
<style>*{font-size: 50px}</style>
<div id=o></div>
<div id=msg></div>
<script>
const BACK = "🎴";
const FOOD = [..."🍄🍅🍆🍇🍈🍉🍊🍋🍌🍍🍎🍏🍐🍑🍒🍓🍔🍕🍖🍗🍘🍙🍚🍛🍜🍝🍞🍟🍠🍡🍢🍣🍤🍥🍦🍧🍨🍩🍪🍫🍬🍭🍮🍯🍰🍱🍲🍳"];
const TYPE_COUNT = 4;
const COLUMNS = Math.ceil(Math.sqrt(TYPE_COUNT * 2));
const cards = [];
let indexA = indexB = -1;
@lewdev
lewdev / string-to-array-based-on-char limit.md
Created April 15, 2023 02:33
👨‍💻 Convert a string to an array given a set of words and character limit. Each array element string cannot exceed

👨‍💻 Convert a string to an array given a set of words and character limit

<p id=o></p>
<script>
const toStrArraySize = (str, limit) => str.split(/\s+/).reduce((arr, word, i) => {
  if ([...arr[arr.length - 1], word].join(" ").length > limit) {
    arr.push([word]);
  }
  else {
    arr[arr.length - 1].push(word);
@lewdev
lewdev / emoji-favicon.md
Last active April 14, 2023 04:40
😀 Use Emoji as your favicon (🔖Bookmarklet)

😀 Use Emoji as your favicon

Adjust the x, y, and font-size attributes in the text element to get your specific emoji to be centered and fit. Emojis have differing widths and heights.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="1.045em" font-size="72">👨‍💻</text></svg>

Then put it in an icon meta tag. Be sure to replace the double-quotes with %22.

<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>📂</text></svg>">