Skip to content

Instantly share code, notes, and snippets.

View nick1n's full-sized avatar
🤓

Nick nick1n

🤓
View GitHub Profile
@nick1n
nick1n / tiny-cuid.js
Created October 22, 2022 23:43
Tiny cuid, not secure, fast, less than 170 bytes, uses a random session id instead of fingerprint.
let
text,
base36 = (number) => number.toString(36),
randomStr = (length) => {
for (
text = "";
text.length < length;
text = base36(Math.random()).slice(2, length + 2)
);
return text
@acorn1010
acorn1010 / generate_images.sh
Last active November 25, 2022 14:46
Foony Generate Images Script (credit keraion)
#!/usr/bin/env bash
# Credit to keraion for huge readability improvements and parallelization.
set -e
# Creates webp / avif images for images that don't already exist and places them in the public folder
# This script can take a while to run
# Install deps
# sudo apt-get install -f webp ffmpeg
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@nick1n
nick1n / Default (Windows).sublime-keymap
Last active May 25, 2017 22:17
My Sublime settings
[
// Shows the build console, or at least it use to
{ "keys": ["ctrl+shift+b"], "command": "show_panel", "args": {"panel": "output.exec"} },
// Makes it so Ctrl + Tab or Ctrl + Shift + Tab go between tabs in the
// order that they are displayed and not the order that they were opened.
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }
]
@nick1n
nick1n / TODO
Last active October 2, 2015 11:49
TODO
TODO:
some indication to the user when clicking the submit button without a username (...maybe more than just a red border)
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];