This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof Typekit != 'undefined') { | |
try { | |
Typekit.load({ | |
active: function() { | |
// it worked. carry on ... | |
} | |
}); | |
} catch(e) { | |
// probably want to fall back to no typekit | |
$('html').addClass('wf-inactive').removeClass('wf-loading'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A redis autocomplete example for multi-word phrases. | |
Based on: | |
Ruby original: http://gist.github.com/574044 | |
Python original: https://gist.github.com/577852 | |
See options below for usage | |
Requires http://github.com/andymccurdy/redis-py/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0 | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sudoku solver in CoffeeScript based on the Python solution by Peter Norvig | |
# http://norvig.com/sudoku.html | |
# 2011-04-19 [email protected] | |
# | |
# Throughout this program we have: | |
# r is a row, e.g. 'A' | |
# c is a column, e.g. '3' | |
# s is a square, e.g. 'A3' | |
# d is a digit, e.g. '9' | |
# u is a unit, e.g. ['A1','B1','C1','D1','E1','F1','G1','H1','I1'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Jison grammar for converting numerals into an integer */ | |
/* The lexical analyzer | |
How we break things up into tokens */ | |
%lex | |
%% | |
[0-9]+ return 'INT' | |
"-" return '-' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Part of the grammar of Steve */ | |
%lex | |
%% | |
\s+ { /* ignore whitespace */ } | |
[0-9]+"."[0-9]+\b { return 'FLOAT'; } | |
[0-9]+\b { return 'INT'; } | |
\"[^\"]+\" { yytext = yytext.substr(1, yyleng-2); return 'STR'; } | |
"int" return 'INTTYPE' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// express + socket.io example (chat server) | |
// that requires authentication via ldap. | |
// express shares authentication with socket.io. | |
var express = require('express'); | |
var io = require('socket.io'); | |
var ldap = require('./lib/node-ldapauth/ldapauth'); | |
var sessionStore = new express.session.MemoryStore(); // whatever | |
var parseCookie = require('connect').utils.parseCookie; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# must set this vi_cv_path_python_plibs var | |
# people say having a trailing slash on the python-config-dir causes problems | |
$ export vi_cv_path_python_plibs="-L/usr/lib64/python2.7/config -lpython2.7 -ldl" | |
$ ./configure --enable-cscope \ | |
--enable-multibyte \ | |
--enable-gui \ | |
--with-python-config-dir=/usr/lib64/python2.7/config \ | |
--enable-pythoninterp=yes \ | |
--with-x \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyvows import Vows, expect | |
@Vows.batch | |
class IfATestFails(Vows.Context): | |
def topic(self): | |
return "oh noes!" | |
def setup(self): | |
print "test 1 setup: this will be printed" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util'); | |
var events = require('events'); | |
var redis = require('redis'); | |
var RedisQueueConsumer = function (port, host) { | |
events.EventEmitter.call(this); | |
this.port = port || 6379; | |
this.host = host || '127.0.0.1'; | |
}; |
OlderNewer