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
@nick1n
nick1n / bookmark-help.js
Created January 2, 2015 17:59
Bookmark help for mobile phones
// Bookmark help for phones
var isMobile = {
Android: navigator.userAgent.match(/Android/i),
BlackBerry: navigator.userAgent.match(/BlackBerry/i),
iOS: navigator.userAgent.match(/iPhone|iPad|iPod/i),
Opera: navigator.userAgent.match(/Opera Mini/i),
Windows: navigator.userAgent.match(/IEMobile/i),
any: function() {
return isMobile.Android || isMobile.BlackBerry || isMobile.iOS || isMobile.Opera || isMobile.Windows;
}
$.fn.equalheight = function( remove ) {
// Reset heights from the last viewport resize so that values do not get wacky-large.
this.height('auto');
// if remove is true, just reset the heights and return
if ( remove ) {
return;
}
@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 / OreQuarry.lua
Last active March 13, 2021 13:07
Minecraft Mining Turtle Ore Quarry with Resume by AustinKK, Aeolun, nick1n (untested) http://www.computercraft.info/forums2/index.php?/topic/7675-advanced-mining-turtle-ore-quarry/
-- ********************************************************************************** --
-- ** ** --
-- ** Minecraft Mining Turtle Ore Quarry v0.6c by AustinKK, Aeolun, nick1n ** --
-- ** --------------------------------------------------- ** --
-- ** ** --
-- ** For instructions on how to use: ** --
-- ** ** --
-- ** http://www.youtube.com/watch?v=PIugLVzUz3g ** --
-- ** ** --
-- ** Change Log: ** --
@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)