Skip to content

Instantly share code, notes, and snippets.

@lsauer
lsauer / gist:2850506
Created June 1, 2012 08:55
Javascript: using placeholders %s, %d... in the javascript console and in strings - C++ sprintf-like syntax
/** www.lsauer.com 2011
* http://www.lsauer.com/2011/08/javascript-using-placeholders-s-d-in.html
*/
var r = (r||{
t : "check",
m : "mate",
c: 10.10
});
console.log('It is '+r.t+r.m+' for Player A. Game Stat:'+r.c);
@cobyism
cobyism / gh-pages-deploy.md
Last active November 11, 2024 00:02
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@renatomattos2912
renatomattos2912 / unzip tar.gz
Created March 3, 2014 16:52
Unzip tar.gz on mac from terminal
gunzip -c foo.tar.gz | tar xopf -
@paulirish
paulirish / bling.js
Last active November 4, 2024 17:48
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;
@kyraocean
kyraocean / 01-seeyouspacecowgirl.sh
Last active January 24, 2022 03:04
SEE YOU SPACE COWBOY|GIRL cosmic-colored terminal logout
#!/usr/bin/env bash
# SEE YOU SPACE COWGIRL by KYRA OCEAN (kyraocean.com) (July 2014)
# Displays a timeless message in your terminal with cosmic color effects
# Usage: add "sh ~/seeyouspacecowgirl.sh; sleep 2" to .bash_logout (or similar) in your home directory
# (adjust the sleep variable to display the message for more seconds)
# Cosmic color sequence