This is intended as a quick reference and showcase. For more complete info, see John Gruber's original spec and the Github-flavored Markdown info page.
Headers
Emphasis
Lists
Links
Images
Code and Syntax Highlighting
Tables
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 |
var net = require('net') | |
var sock = net.connect(1337) | |
process.stdin.pipe(sock) | |
sock.pipe(process.stdout) | |
sock.on('connect', function () { | |
process.stdin.resume(); | |
process.stdin.setRawMode(true) |
/* Gcyrillus - exemple */ | |
html { | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height: 100%; | |
} | |
@keyframes hover_me { | |
0%, 100% {font-size:1em;} | |
50% {font-size:5em;} | |
} |
#!/usr/bin/env node | |
var argv = require('optimist') | |
.usage('Usage: --key=[consumer key] -secret=[consumer secret]') | |
.demand(['key', 'secret']) | |
.argv | |
; | |
var OAuth = require('oauth').OAuth; | |
var Step = require('step'); |
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 |
var USER_AGENT = "nodejs/0.0.1 (node) gist command line tool v0.0.1" | |
, request = require("request") | |
, qs = require('querystring') | |
, URL = require('url') | |
, util = require('util'); | |
//, es5shim = require('es5-shim') | |
//, es6shim = require('es6-shim'); | |
This is intended as a quick reference and showcase. For more complete info, see John Gruber's original spec and the Github-flavored Markdown info page.
Headers
Emphasis
Lists
Links
Images
Code and Syntax Highlighting
Tables
###The Singleton Pattern An entity/class with only a single instance with global access points.
At its core, the singleton pattern can be implemented by creating a class with a method that creates a new instance of the class if one doesn’t exist.
In the event of an instance already existing, it simply returns a reference to that object. The singleton pattern is thus known because traditionally, it restricts instantiation of a class to a single object.
The singleton doesn’t provide a way for code that doesn’t know about a previous reference to the singleton to easily retrieve it - it is not the object or class that’s returned by a singleton, it’s a structure.
Think of how closured variables aren’t actually closures - the function scope that provides the closure is the closure.
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
###Making a Bootable USB with Windows 7/8
-Grab a a Windows 7 ISO image and extract it to a folder (not on the USB stick) You can use a lot of programs, many of them free, to extract from an ISO. I use 7zip. -Grab a 4GB USB stick -Format the USB stick with NTFS using the “quick format”. (You can do this via Windows Explorer) -Open a CMD prompt (run it as administrator) -Run DISKPART -Select the volume for the USB stick. First enter LIST VOL to show the list. -Then enter SELECT VOL x where x is the volume number from the list -Mark the volume as active by entering ACTIVE