var c = 2 * Math.pow(10, 8); var l1 = 400 * 1000; var l2 = 200 * Math.pow(10, 6) * 1000; var p = 1600 * 8; // 1600 bytes var r1 = 2 * Math.pow(10, 6); var r2 = 64 * Math.pow(10, 3); var totalTime;
propagationDelay = function (c, l) { return l / c;
describe "calculator", -> | |
it "should call the given method when parameter is valid", -> | |
# create mocks to | |
# 1. spy its behavior | |
# 2. verify the method call | |
# 3. stub the method return | |
# | |
mock = sinon.mock(sample) | |
mock.expects('minus').once().withArgs([1]).returns({}) |
" removing trailing spaces before saving | |
autocmd FileType c,cpp,java,php,coffee,javascript,ruby,python,yaml,sh autocmd BufWritePre <buffer> :%s/\s\+$//e |
development: | |
adapter: postgresql | |
encoding: utf8 | |
database: project_development | |
pool: 5 | |
host: localhost | |
username: | |
password: | |
test: &TEST |
server { | |
listen 80; | |
server_name genghis; | |
root /Users/yangchenyun/sites/genghis; | |
access_log /usr/local/var/log/nginx/genghis.access.log; | |
error_log /usr/local/var/log/nginx/genghis.error.log warn; | |
location / { | |
fastcgi_pass 127.0.0.1:9000; |
{ | |
"pusher": { | |
"name": "none" | |
}, | |
"repository": { | |
"name": ".vim", | |
"created_at": "2012-03-17T03:18:39-07:00", | |
"size": 484, | |
"has_wiki": true, | |
"watchers": 0, |
var c = 2 * Math.pow(10, 8); var l1 = 400 * 1000; var l2 = 200 * Math.pow(10, 6) * 1000; var p = 1600 * 8; // 1600 bytes var r1 = 2 * Math.pow(10, 6); var r2 = 64 * Math.pow(10, 3); var totalTime;
propagationDelay = function (c, l) { return l / c;
var MB = Math.pow(2, 20); var Mb = Math.pow(10, 6); var roundTime = 90 / 1000;
bitToMB = function (bit) { return bit / (8 * MB) };
var totalBits = bitToMB(100 * Mb * roundTime)
# GistID: 4245259 | |
module TestModule | |
# invoked when the module itself is extended by class | |
def self.extended(base) | |
puts "#{base} extended with #{self}" | |
end | |
# invoked when the mixined module or class is included in another module | |
# see below for more information | |
def append_features(base) |
# GistID: 4245473 | |
# Examine how ActiveSupport works | |
# https://github.com/rails/rails/blob/master/activesupport/lib/active_support/concern.rb#L110 | |
module Foo | |
# @_dependencies is set to [] within Foo | |
# new class methods append_features and included is added to Foo | |
# they are triggered later by Bar | |
extend ActiveSupport::Concern |
# forward the incoming http request to local port | |
server { | |
listen 80; | |
server_name dev.example.org *.dev.example.org; | |
access_log /var/log/nginx/dev-example-access.log; | |
error_log /var/log/nginx/dev-example-error.log; | |
root /home/yangchenyun/repositories/; |