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
#!/usr/bin/env python | |
import re, collections | |
from subprocess import * | |
def sanitize_keybinding(binding): | |
d = {'space': ' ', | |
'apostrophe': "'", | |
'BackSpace': ' (<-)', | |
'Return': '↵ \n', |
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
class Scanner(): | |
def __init__(self, source): | |
self.source = source | |
self.position = 0 | |
self.buffer = '' | |
self.line = 1 | |
def current(self): | |
return self.source[self.position] |
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
#include <stdio.h> | |
static int SEED = 0; | |
static int hash[] = {208,34,231,213,32,248,233,56,161,78,24,140,71,48,140,254,245,255,247,247,40, | |
185,248,251,245,28,124,204,204,76,36,1,107,28,234,163,202,224,245,128,167,204, | |
9,92,217,54,239,174,173,102,193,189,190,121,100,108,167,44,43,77,180,204,8,81, | |
70,223,11,38,24,254,210,210,177,32,81,195,243,125,8,169,112,32,97,53,195,13, | |
203,9,47,104,125,117,114,124,165,203,181,235,193,206,70,180,174,0,167,181,41, | |
164,30,116,127,198,245,146,87,224,149,206,57,4,192,210,65,210,129,240,178,105, |
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
// Calculates the flux of f(x,y) = x^2/2 + y^2/2 over a cat. CAN I HAZ SUM FLUXZ? | |
#include "flux.h" | |
double M(double x, double y){ | |
return x; // X component of our gradient field. | |
} | |
double N(double x, double y){ | |
return y; // Y component of our gradient field. | |
} |
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
/* | |
* Name: container_of | |
* Parameters: ptr - Pointer to the inner structure that you have. | |
* Parameters: type - The type of outer structure you want to have. | |
* Parameters: member - The member in the outer structure for the inner. | |
* Returns: type * - Pointer to the outer structure you wanted. | |
* Description: | |
* This is a macro used to get to a child structure when you have a pointer | |
* to the root structure. Notice that this makes no checks or validation. | |
* Use when you know what you have and what you want. |
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 Simple Javascript syntax highlighted Editor within 1023 bytes (< 1Kb) | |
// Demo: http://failboat.me/jpad.html | |
(d=document).write('<style>#p,#d{text-shadow:0 0 20px #39E;top:0;left:0;white-space:pre;color:#756;width:100%;height:100%;padding:10px;border:none;line-height:20px;position:absolute;background:transparent;font:14px "Courier New"}#p{opacity:0.4}</style><div id="d">JS</div><textarea id="p"></textarea>');p=d[g="getElementById"]("p");n="length";function j(b,a){l=[];for(_ in a){i=0;$=a[_];for(m=b.match(a[_]);$.test(b);)l.push([$.lastIndex-m[i][n],m[i++][n],_])}l.sort(function(c,f){return c[0]+1/c[1]-f[0]-1/f[1]});h=0;z=[];for(_ in l){$=l[_];e=$[0]+$[1];if(!(e<=h)){z.push([h,$[0]-h,g],$);h=e}}z.push([h,b[n],g]);return z}p.onkeyup=function(){var b=d[g]("d"),a=p.value;t=j(a,{"#288;border-bottom:dashed 1px #ccc":/\/\/.*|\/\*(.|\n)+\*\//g,"#D24":/"[^"\n]*"|'[^'\n]*'/g,"#08c":/\b(else|switch|break|throw|case|catch|new|finally|null|try|const|for|continue|function|var|if|return|delete|while|do|with|in)(?!\w)/g} |
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 - HTTP - Copyright TJ Holowaychuk <[email protected]> (MIT Licensed) | |
/** | |
* Module dependencies. | |
*/ | |
var http = require('http'), | |
parse = require('url').parse, | |
queryString = require('querystring') |
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
#include "ruby.h" | |
#include "Python.h" | |
// #include "sre.h" | |
#include "re.h" | |
#include "st.h" | |
#include "rubyio.h" | |
// #include "structmember.h" -- Clashes with Ruby | |
#include <string.h> | |
/* |
NewerOlder