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
Copyright © 2014 Jose Luis Rivas | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in |
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
#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 |
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
MotionNotify 569 286 | |
KeyStrPress Shift_L | |
KeyStrPress semicolon | |
KeyStrRelease semicolon | |
KeyStrRelease Shift_L | |
KeyStrPress Shift_L | |
KeyStrPress 1 | |
KeyStrRelease 1 | |
KeyStrPress 3 | |
KeyStrRelease 3 |
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
// UTF8 Module | |
// | |
// Cleaner and modularized utf-8 encoding and decoding library for javascript. | |
// | |
// copyright: MIT | |
// author: Nijiko Yonskai, @nijikokun, nijikokun@gmail.com | |
(function (name, definition, context, dependencies) { | |
if (typeof context['module'] !== 'undefined' && context['module']['exports']) { if (dependencies && context['require']) { for (var i = 0; i < dependencies.length; i++) context[dependencies[i]] = context['require'](dependencies[i]); } context['module']['exports'] = definition.apply(context); } | |
else if (typeof context['define'] !== 'undefined' && context['define'] === 'function' && context['define']['amd']) { define(name, (dependencies || []), definition); } | |
else { context[name] = definition.apply(context); } |
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
module T | |
def self.display | |
puts "display 1" | |
end | |
end | |
T.display | |
def T.display | |
puts "display 2" |
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
class FileDb < Hash | |
attr_accessor :path | |
def initialize | |
super | |
end | |
def self.open(path) | |
f = self.new |
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 request = require("request"); | |
var qstr = require("querystring").stringify; | |
var Args = require("args-js"); | |
var utils = require("../utils"); | |
var etcd = module.exports = {}; | |
var watchers = etcd.watchers = {}; | |
var timeout_code = "ESOCKETTIMEDOUT"; |
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
// From: https://stackoverflow.com/a/14041378 | |
function toUserTimeZone(utc_date, offset){ | |
if (utc_date.slice(-3) !== "UTC") { | |
utc_date += " UTC"; | |
} | |
var local_date = new Date(utc_date); | |
var local_offset = local_date.getTimezoneOffset() * 60000; | |
var utc_time = local_date.getTime() + local_offset; | |
return new Date(utc_time + (3600000 * offset)); |
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
# To compile `mrbc -o mrbc_fail.mrb mrbc_fail.rb` | |
class_decation_error T | |
def self.a | |
puts "aa" | |
end | |
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
// Bookmark url (remember to update the https link inside it for your fork): | |
// javascript:(function(){var d=document,s=d.createElement('script');s.src='https://cdn.rawgit.com/sadasant/1d51bd8d26b5fd94f9f3/raw/read.js';d.body.appendChild(s);}()) | |
if (window.READING) { | |
alert("READ is already available :)"); | |
} else { | |
(function() { | |
var READING = window.READING = {}; | |
READING.delay = 100; | |
READING.extra = 100; | |
READING.top = 100; |
OlderNewer