Skip to content

Instantly share code, notes, and snippets.

@sontek
sontek / snowjob.py
Created Dec 22, 2011
Make your terminal snow with python
View snowjob.py
#!/usr/bin/env python
import os
import random
import time
import platform
snowflakes = {}
try:
# Windows Support
@tj
tj / app.js
Created Dec 17, 2011
express 3.x cookie session middleware example
View app.js
var express = require('express')
, cookieSessions = require('./cookie-sessions');
var app = express();
app.use(express.cookieParser('manny is cool'));
app.use(cookieSessions('sid'));
app.get('/', function(req, res){
req.session.count = req.session.count || 0;
View batch.js
/**
* Expose `Batch`.
*/
module.exports = Batch;
/**
* Create a new Batch.
*/
@paulirish
paulirish / data-markdown.user.js
Last active Jul 2, 2022
*[data-markdown] - use markdown, sometimes, in your HTML
View data-markdown.user.js
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@pamelafox
pamelafox / personalize.js
Created Oct 12, 2011
Javascript grammatical personalization library
View personalize.js
/**
* A function that takes a template and grammatical options ('gender', 'person', 'name') and returns the computed string.
* See below for examples.
*
* See wikipedia for more on grammar:
* http://en.wikipedia.org/wiki/English_personal_pronouns
* http://en.wikipedia.org/wiki/Grammatical_conjugation
*/
function personalize(template, options) {
var GENDERS = ['neutral', 'female', 'male'];
@ded
ded / cmd
Created Sep 21, 2011
ender | backbone
View cmd
ender build backbone
View gist:1202895
You'll need:
- Old Fashioned glasses, two of
- Sugar cubes, two of
- Peychaud's Aromatic Cocktail Bitters, one bottle of
- Ice, enough to fill both glasses
- Water, one oz of
- Rye whisky, two oz of
- St. George Absinthe Verte, 0.333oz of
- Lemon, one twist of
@3rd-Eden
3rd-Eden / exports.readonly.js
Created Aug 11, 2011
Different ways of configuring nodejs
View exports.readonly.js
/**
* Configuration. This file is read only
*
* @api private
*/
module.exports = Object.freeze({
pewpew: "moo"
});
@jed
jed / LICENSE.txt
Created May 10, 2011 — forked from 140bytes/LICENSE.txt
route client urls with 404s and pattern captures
View LICENSE.txt
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
View primer.js
!function() {
var doc = document,
htm = doc.documentElement,
lct = null, // last click target
nearest = function(elm, tag) {
while (elm && elm.nodeName != tag) {
elm = elm.parentNode;
}
return elm;
};