This file contains 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
find . -name \*.h -exec wc {} \; > /tmp/src.txt | |
find . -name \*.c -exec wc {} \; >> /tmp/src.txt | |
cat sample.py | |
total = 0 | |
myfile = open('src.txt') | |
lines = myfile.readlines() | |
for line in lines: | |
print line.split()[0] |
This file contains 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://www.ietf.org/rfc/rfc1928.txt | |
// Tested with: curl http://www.google.se/ --socks5 1080 --proxy-user foo:bar | |
var States = { | |
CONNECTED:0, | |
VERIFYING:1, | |
READY:2, | |
PROXY: 3 | |
}; |
This file contains 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
<!doctype html> | |
<title>Canvas spinner</title> | |
<link rel=stylesheet href=s.css> | |
<script src=s.js></script> |
This file contains 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
/* Inspired by Python's useful re.findall method */ | |
function findall(regex, str) { | |
var matches = [], m; | |
regex.lastIndex = 0; | |
while (m = regex.exec(str, regex.lastIndex)) { | |
matches[matches.length] = m; | |
} | |
return matches; | |
} |
This file contains 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
# this can be put in [repo]/.git/config for local settings | |
# or ~/.gitconfig for global settings | |
# create a difftool "nodiff" that just returns true | |
# this path is for Mac. On linux it's /bin/true i guess | |
[diff "nodiff"] | |
command = /usr/bin/true | |
# make git ignore white space differences, many different possibilites here |
This file contains 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
<!DOCTYPE html> | |
<meta charset=utf-8> | |
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1"> | |
<meta name=apple-mobile-web-app-capable content=yes> | |
<meta name=apple-mobile-web-app-status-bar-style content=black> | |
<title>Test fullscreen</title> | |
<style> | |
html, body { | |
margin: 0; | |
padding: 0; |
This file contains 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
// Generated via: | |
// node -e "s=require('http').STATUS_CODES;Object.keys(s).map(function(c){console.log('#define HTTP_STATUS_%d %j',c,c+' '+s[c])})" | |
#define HTTP_STATUS_100 "100 Continue" | |
#define HTTP_STATUS_101 "101 Switching Protocols" | |
#define HTTP_STATUS_102 "102 Processing" | |
#define HTTP_STATUS_200 "200 OK" | |
#define HTTP_STATUS_201 "201 Created" | |
#define HTTP_STATUS_202 "202 Accepted" | |
#define HTTP_STATUS_203 "203 Non-Authoritative Information" |
This file contains 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
import org.json.JSONArray; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
import java.util.*; | |
public class JsonHelper { | |
public static Object toJSON(Object object) throws JSONException { | |
if (object instanceof Map) { | |
JSONObject json = new JSONObject(); |
This file contains 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
@mixin background_image ($filename) { | |
background-image: image-url(1x/#{$filename}); | |
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), | |
only screen and (-o-min-device-pixel-ratio: 3/2), | |
only screen and (min--moz-device-pixel-ratio: 1.5), | |
only screen and (min-device-pixel-ratio: 1.5) { | |
background-image: image-url(2x/#{$filename}); | |
} | |
} |
This file contains 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
/** | |
* Requires node v0.7.7 or greater. | |
* | |
* To connect: $ curl -sSNT. localhost:8000 | |
*/ | |
var http = require('http') | |
, repl = require('repl') | |
, buf0 = new Buffer([0]) |
OlderNewer