Skip to content

Instantly share code, notes, and snippets.

View luminarious's full-sized avatar
🃏
    ​

Hardi Kõvamees luminarious

🃏
    ​
View GitHub Profile
@paulirish
paulirish / bling.js
Last active April 20, 2024 17:39
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@mikelehen
mikelehen / generate-pushid.js
Created February 11, 2015 17:34
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@zamicol
zamicol / post-receive
Last active July 22, 2022 21:47
Git push to prod
#!/bin/sh
# Use git to push to deploy (aka git push to prod)
# Use 'git push remote master' to push to deploy
# This script only deploys on pushes to master.
#
# HOWTO:
# On your server to deploy, create a bare git directory
# (somewhere like /var/git/<gitProject>)
# Your depoly directory (like /var/www) should be somewhere other than your git repo.
@feedmypixel
feedmypixel / xmlToJson
Created November 27, 2012 10:41
Convert XML to JSON. This is a version that provides a JSON object without the attributes and places textNodes as values rather than an object with the textNode in it.
/**
* Originally from http://davidwalsh.name/convert-xml-json
* This is a version that provides a JSON object without the attributes and places textNodes as values
* rather than an object with the textNode in it.
* 27/11/2012
* Ben Chidgey
*
* @param xml
* @return {*}
*/
@saetia
saetia / gist:1623487
Last active March 19, 2024 15:21
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE