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 util = require('util'); | |
var fs = require('fs'); | |
var type = function(data, completer) { | |
var lines = data.split(' '); | |
var i = 0; | |
var timer = setInterval(function() { | |
var s = lines[i++]; | |
while (lines[i] == '') { |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
function shorten() { | |
var s = document.getElementById("url").value.match(/^https?:\/\/[^/]*\bflickr\.com\/(photos\/[^/]+\/(\d+))/i); | |
if (s && s.length && s[2]) { | |
var num = s[2]; | |
if (typeof num !== 'number') { | |
num=parseInt(num); | |
} |
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/local/bin/node | |
var assert = require('assert'); | |
// utils | |
Array.prototype.swap = function(a, b) { | |
if (a == b) { | |
return; | |
} | |
var tmp = this[a]; |
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/local/bin/node | |
var fs = require('fs'); | |
var file = process.argv[2]; | |
if (!file) throw 'no input file'; | |
var seq = false; | |
if (file == '-s') { | |
if (!process.argv[3]) throw 'no input file'; |
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
Alice|Bob|Carol | |
1|1->2|INVITE(hello) | |
2|2->3|INVITE | |
-|3|waiting... | |
3|2<-3|200OK | |
4|1<-2|200OK |
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
/* | |
CSS stylesheet is based on Kevin Burke's Markdown.css project: | |
http://kevinburke.bitbucket.org/markdowncss | |
For code highlighting: | |
<link rel="stylesheet" href="http://yandex.st/highlightjs/6.1/styles/magula.min.css"> | |
<script src="http://yandex.st/highlightjs/6.1/highlight.js"></script> | |
<script src="http://yandex.st/highlightjs/6.1/languages/cpp.min.js"></script> | |
<script>hljs.initHighlightingOnLoad();</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
#!/usr/local/bin/node | |
var fs = require('fs'); | |
Function.prototype.mlstr = function() { | |
var lines = new String(this); | |
return lines.substring(lines.indexOf("/*") + 2, lines.lastIndexOf("*/")); | |
}; | |
String.prototype.dup = function(n) { | |
var sb = ''; |
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
#!/bin/bash | |
returnVal=() | |
convertArgsStrToArray() { | |
local concat="" | |
local t="" | |
returnVal=() | |
for word in $@; do | |
local len=`expr "$word" : '.*"'` |
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/local/bin/node | |
var Registry = function() { | |
this.r = [null]; | |
}; | |
Registry.prototype.register = function(object) { | |
var id = this.r[0]; | |
if (id === null) { | |
this.r.push(object); |
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
#include <iostream> | |
#include <string> | |
using namespace std; | |
std::string escapeXml(const std::string& s) { | |
std::string ret; | |
std::string::size_type i = 0; | |
std::string::size_type pos = 0; | |
for (; i != s.size(); ++i) { | |
std::string rep; |
OlderNewer