start new:
tmux
start new with session name:
tmux new -s myname
#Refer: http://www.linuxfoundation.org/collaborate/workgroups/networking/netem#Delaying_only_some_traffic | |
#Refer: http://www.bomisofmab.com/blog/?p=100 | |
#Refer: http://drija.com/linux/41983/simulating-a-low-bandwidth-high-latency-network-connection-on-linux/ | |
#Setup the rate control and delay | |
sudo tc qdisc add dev lo root handle 1: htb default 12 | |
sudo tc class add dev lo parent 1:1 classid 1:12 htb rate 56kbps ceil 128kbps | |
sudo tc qdisc add dev lo parent 1:12 netem delay 200ms | |
#Remove the rate control/delay | |
sudo tc qdisc del dev lo root |
/** | |
* ## Merging mixin views in backbone.js ## | |
* | |
* really just more a test for tumblr gistr | |
*/ | |
/** | |
* Merge the mixin (a Backbone.View) into another Backbone.View. Automatically merge events, defaults, and call the parent initializer. | |
**/ | |
function mergeMixin(view, mixin) { |
#!/usr/bin/env sh | |
# Download lists, unpack and filter, write to stdout | |
curl -s https://www.iblocklist.com/lists.php \ | |
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| xargs wget -O - \ | |
| gunzip \ | |
| egrep -v '^#' |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
This bash script offers quick shortcuts to simulate slower network connections. It is useful when you need to simulate a wireless network on a Linux network server, especially when you are using a virtual machine guest on your local machine or in the cloud.
slow 3G # Slow network on default eth0 down to 3G wireless speeds
slow reset # Reset connection for default eth0 to normal
slow vsat --latency=500ms # Simulate satellite internet with a high latency
slow dsl -b 1mbps # Simulate DSL with a slower speed than the default
slow modem-56k -d eth0 # Simulate a 56k modem on the eth1 device. eth0 is unchanged.
/** | |
* Add dataset support to elements | |
* No globals, no overriding prototype with non-standard methods, | |
* handles CamelCase properly, attempts to use standard | |
* Object.defineProperty() (and Function bind()) methods, | |
* falls back to native implementation when existing | |
* Inspired by http://code.eligrey.com/html5/dataset/ | |
* (via https://github.com/adalgiso/html5-dataset/blob/master/html5-dataset.js ) | |
* Depends on Function.bind and Object.defineProperty/Object.getOwnPropertyDescriptor (polyfills below) | |
* All code below is Licensed under the X11/MIT License |
// Original method | |
var object = { | |
method: function (x, y) { | |
return x+y; | |
} | |
} | |
// Add operations before or after! | |
object.method = (function (original) { | |
return function (x, y) { |
module.exports = function (grunt) { | |
grunt.initConfig({ | |
connect: { | |
jasmine: { | |
options: { | |
hostname: 'localhost', | |
port: 9001 | |
} | |
} |
module.exports = function (grunt) { | |
grunt.initConfig({ | |
jshint: { | |
all: { | |
src: 'public/javascripts/app/*.js', | |
options: { | |
bitwise: true, | |
camelcase: true, |