Skip to content

Instantly share code, notes, and snippets.

View justsml's full-sized avatar
🔥
#BLM

Dan Levy justsml

🔥
#BLM
View GitHub Profile
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@eligrey
eligrey / insertAdjacentHTML.js
Created October 10, 2011 18:06
insertAdjacentHTML polyfill
/*
* insertAdjacentHTML.js
* Cross-browser full HTMLElement.insertAdjacentHTML implementation.
*
* 2011-10-10
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@mcdado
mcdado / Bcrypt.php
Created April 22, 2012 15:37
PHP Bcrypt class
<?php
/*
bcrypt class for PHP 5.3 and above.
An implentation by Marco Arment.
It uses Blowfish hashing.
Simplified by David Gasperoni <mcdado@gmail.com>.
Forked from Marco Arment <me@marco.org>.
This code is released in the public domain.
@connrs
connrs / qsa-polyfill-ie7.js
Created May 18, 2012 09:49
IE7 querySelectorAll polyfill
if (!document.querySelectorAll) {
document.querySelectorAll = function(selector) {
var doc = document,
head = doc.documentElement.firstChild,
styleTag = doc.createElement('STYLE');
head.appendChild(styleTag);
doc.__qsaels = [];
styleTag.styleSheet.cssText = selector + "{x:expression(document.__qsaels.push(this))}";
window.scrollBy(0, 0);
@rafagarcia
rafagarcia / tinydomready.js
Created November 28, 2012 08:29 — forked from dciccale/README.md
Tiny Cross-browser DOM ready function (120 bytes)
// @param {function} f The function to execute when DOM is ready
function a(f,o,m){o=document,m='addEventListener';o[m]?o[m]('DOMContentLoaded',f):(o=window,o.attachEvent('onload',f));}
@caruccio
caruccio / bash-path-vars
Last active December 28, 2023 22:47
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts
@acdha
acdha / convert-css-to-sass.bash
Created January 16, 2013 21:08
Bulk-convert CSS to SASS SCSS using css2sass, curl and xmlstarlet
#!/bin/bash
for f in *.css; do
echo $f ${f/.css/.scss};
curl -s -X POST http://css2sass.heroku.com/xml --data-urlencode "page[css]@$f" -d commit="Convert 2 SCSS" | xmlstarlet sel -t -v /page/sass | xmlstarlet unesc > ${f/.css/.scss};
done
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: