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
// Script to Generate Random Graphics for Moo Cards | |
// Example: http://www.flickr.com/photos/jpick/3335073434/ | |
// Modified from Google example - same license as Top Draw (Google BSD-style) | |
var name = "Jim Pick"; | |
//var fontName = "Data70SH-Regular"; | |
var fontName = "Helvetica"; | |
// Fill with desktop with Colored rect with same top left and bottom right colors | |
var db = new Rect(0, 0, 1040, 696); |
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 python | |
# | |
# udp_hole_punch_tester.py - UDP Hole Punching test tool | |
# | |
# Usage: udp_hole_punch_tester.py remote_host remote_port | |
# | |
# Run this script simultaneously on 2 hosts to test if they can punch | |
# a UDP hole to each other. | |
# | |
# * remote_port should be identical on 2 hosts. |
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"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
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
JSDot: http://code.google.com/p/jsdot/ | |
Graph Dracula: http://www.graphdracula.net/ | |
Protovis: http://vis.stanford.edu/protovis/ex/ | |
Rubyvis: http://rubyvis.rubyforge.org/ | |
Infovis: http://thejit.org/ | |
Arbor: http://arborjs.org/ | |
BINViz: http://binviz.sourceforge.net/ | |
NodeBox: http://nodebox.net/code/index.php/Home | |
Springy: https://github.com/dhotson/springy | |
Flare: http://flare.prefuse.org/ |
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 <Foundation/Foundation.h> | |
@interface FOOPSDWriter : NSObject { | |
NSMutableData *data_; | |
NSUInteger location_; | |
} | |
- (void) writeInt64:(UInt64)value; | |
- (void) writeInt32:(UInt32)value; |
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
public static IEnumerable<string> GetFiles(string path) { | |
Queue<string> queue = new Queue<string>(); | |
queue.Enqueue(path); | |
while (queue.Count > 0) { | |
path = queue.Dequeue(); | |
foreach (string subDir in Directory.GetDirectories(path)) { | |
queue.Enqueue(subDir); | |
} | |
string[] files = null; | |
files = Directory.GetFiles(path); |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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 phantomjs | |
// -*- js2 -*- | |
var webpage = require('webpage') | |
, system = require('system') | |
, URL, FILENAME, W, H; | |
; | |
if (system.args.length < 2 || system.args.length > 5) { | |
console.log('Usage: svg2png source.svg output.png [width||?] [height||?]'); |
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
function go() { | |
var userId = prompt('Username?', 'Guest'); | |
var userData = { name: userId }; | |
tryCreateUser(userId, userData); | |
} | |
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users'; | |
function userCreated(userId, success) { | |
if (!success) { |
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
// | |
// main.m | |
// Just a little test case for Objective-C 2.0 on Ubuntu | |
// | |
// Created by Tobias Lensing on 2/22/13. | |
// More cool stuff available at blog.tlensing.org. | |
// | |
#import <Foundation/Foundation.h> | |
#import <AppKit/AppKit.h> |
OlderNewer