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
var http = require('http'); | |
var sys = require('sys'); | |
function request() | |
{ | |
var host = 'google.com'; | |
var client = http.createClient(443, host, true); | |
var request = client.request('GET', '/', | |
{'host': host}); | |
request.end(); |
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
{ | |
"base_url" : "http://github.com/api/v2/", | |
"version" : "0.4", | |
"methods" : { | |
"user_search" : { | |
"path" : "/:format/user/search/:search", | |
"method" : "GET", | |
"required_params" : [ | |
"format", | |
"search" |
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
# General config: | |
# --------------- | |
setw -g utf8 on | |
set -g lock-after-time 1800 | |
set-window-option -g automatic-rename off | |
set -g default-terminal screen | |
# Look & feel: | |
# ------------ | |
# Panes colors |
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 src/ -name *.erl -exec sh -c "mv '{}' /tmp/plop && cp source.txt '{}' && cat /tmp/plop >> '{}' && rm /tmp/plop" \; |
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
var base64 = require('base64'); | |
var assert = require('assert'); | |
function roundTrip(str) { | |
assert.equal(base64.decode(base64.encode(new Buffer(str, 'utf8'))), str); | |
} | |
['Hello', 'États-Unis'].forEach(roundTrip); |
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
// mkdir indextank | |
// wget https://github.com/SPORE/api-description/blob/master/services/indextank.json | |
// install node and npm | |
// npm install spore underscore futures | |
// edit baseUrl, password and index var | |
// node indextank.js | |
var baseUrl = 'http://xxx.api.indextank.com'; | |
var password = 'xxx'; | |
var index = 'test_spore'; |
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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'jekyll' | |
def get_name(title, time) | |
slug = title.strip.downcase.gsub(/'/, '').gsub(/"/, '').gsub(/(&|&)/, ' and ').gsub(/[\s\.\/\\]/, '-').gsub(/[^\w-]/, '').gsub(/[-_]{2,}/, '-').gsub(/^[-_]/, '').gsub(/[-_]$/, '') | |
name = time.strftime("%Y-%m-%d-") + slug + '.md' | |
end | |
(1..307).each do |node_id| |
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> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<title>Chrome bug position fixed</title> | |
<style type="text/css"> | |
.topbar { | |
left: 0; | |
position: fixed; | |
top: 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
#!/usr/bin/env sh | |
# Under WTPL 2 | |
# https://github.com/AdamN/python-webkit2png | |
COMMITS=$(git log --format="%H" --reverse) | |
OUTPUT_DIR="/tmp" | |
i=0 | |
for commit in ${COMMITS} | |
do |
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
#!/usr/bin/env node | |
// modify here | |
var downloadURL = "http://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz" | |
var dest = "/tmp/result" | |
// require | |
var http = require('http') | |
var url = require('url') | |
var fs = require('fs') |
OlderNewer