var dummySocket = new ReadWriteNetStream();
// Debug
dummySocket.on('data', function(data){
console.log('write received', data);
});
dummySocket.write('hey !');
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
var obj = {a:1,b:2,c:9,d:10,f:5}; | |
Object.defineProperty(Object.prototype, "filter", { | |
value: function(f) { | |
return Object.keys(this).reduce(function(m, k) { | |
return f(this[k], k, this) ? (m[k] = this[k], m) : m; | |
}.bind(this), {}); | |
}, | |
enumerable: false, | |
writable: true |
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
[program:myplayapp] | |
; remove -Dconfig.file if necessary (play will use the default application.conf) | |
; change address and port if necessary or remove them to use the default values | |
command=java -Xms128M -Xmx512m -cp .:./lib/*:./target/staged/* -Dhttp.address=127.0.0.1 -Dhttp.port=9000 -Dconfig.file=./conf/application.prod.conf play.core.server.NettyServer . | |
: directory to the play framework app, where "myapp/" is the root | |
directory=/dir/to/myapp | |
process_name=myplayapp | |
autorestart=true | |
startsecs=10 | |
stopwaitsecs=10 |
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
# by https://twitter.com/consoleguru/status/371876352523517952 | |
# tested on Debian, does not work on MacOS | |
alias netgrep='sudo netstat --inet -W -l -p --numeric-ports|grep $*' |
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
# --- !Ups | |
CREATE TABLE users( | |
email VARCHAR(255) NOT NULL PRIMARY KEY, | |
name VARCHAR(255) | |
); | |
CREATE TABLE subjects( | |
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | |
title LONGTEXT NOT NULL, |
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
<html> | |
<head> | |
<title>Redis Listener</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var conn; | |
var msg = $("#msg"); | |
var log = $("#log"); | |
function appendLog(msg) { |
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
<html> | |
<head> | |
<title>Redis Listener</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var conn; | |
var msg = $("#msg"); | |
var log = $("#log"); | |
function appendLog(msg) { |
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 sh | |
# Usage: | |
# infoq.sh "www.infoq.com/presentations/twitter-soa" | |
curl -s -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10')" $1 | grep "<source src=" | |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
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
<body> | |
<div class="app container"> | |
<div class="row-fluid"> | |
<div class="span12"> | |
<h2 class="app-heading">Facebook Friends App</h2> | |
<div class="app-toolbar btn-group"> | |
<button class="btn" id="byName">Sort by name</button> | |
<button class="btn" id="byBirthday">Sort by birthday</button> | |
<input type="text" placeholder="Type something to look for..." /> | |
<button class="btn btn-danger" id="removeSearch"> |