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
players = []; | |
function onYouTubeIframeAPIReady() { | |
_.each($('.article__video-frame'), function(item, i) { | |
var player = new YT.Player('player' + i, { | |
height: '400', | |
width: '700', | |
videoId: $(item).attr('data-vid'), | |
events: { | |
'onStateChange': onPlayerStateChange | |
} |
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 Bar | |
module ClassMethods | |
# `new` is a class method on the `Class` object | |
# It then uses `send` to access `initialize` which would otherwise be a private instance method | |
# So it can be overridden by extending the your class with a new `new` class method | |
def new(*args, &block) | |
super | |
p "new constructor defined" | |
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
import { Injectable, Optional } from '@angular/core'; | |
import { ActivatedRoute, Router } from '@angular/router'; | |
import { Http, Headers, Request, RequestMethod, RequestOptions } from '@angular/http'; | |
import { Observable } from 'rxjs/Observable'; | |
import 'rxjs/add/operator/share'; | |
import 'rxjs/add/observable/interval'; | |
import 'rxjs/add/observable/fromEvent'; | |
import 'rxjs/add/operator/pluck'; | |
import 'rxjs/add/operator/filter'; | |
var Angular2TokenService = (function () { |
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
describe "scopes" do | |
# this doesn't work for state machine | |
# it "has scope :repaid" do | |
# AccountTransaction.should respond_to(:repaid) | |
# AccountTransaction.repaid.where_values_hash.should == { :state => :repaid } | |
# end | |
# The easiest solution | |
before(:all) do |
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
gem 'torquebox', '4.0.0.alpha1' | |
jruby-1.7.16.1 | |
$ wrk -t20 -c100 -d50s http://localhost:8080/ | |
Running 50s test @ http://localhost:8080/ | |
20 threads and 100 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 12.72ms 30.65ms 515.79ms 97.38% | |
Req/Sec 538.06 129.53 2.20k 78.01% | |
528710 requests in 50.00s, 90.20MB read |
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
<div class="select-date-period" id="date-popup" style="display: none;"> | |
<ul class="dates"> | |
<li class="selected" data-start="<%= Date.today %>" data-end="<%= Date.today %>"> | |
<span><%= t :today %></span></li> | |
<li class="" data-start="<%= Date.yesterday %>" data-end="<%= Date.today %>"> | |
<span><%= t :yesterday %></span></li> | |
<li class="" data-start="<%= 7.days.ago.to_date %>" data-end="<%= Date.today %>"> | |
<span><%= t :last_7_days %></span></li> | |
<li class="" data-start="<%= 30.days.ago.to_date %>" data-end="<%= Date.today %>"> | |
<span><%= t :last_30_days %></span></li> |
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
# interpreted AST | |
system ~/projects/jruby $ jruby.bash -X-C mandelbrot.rb 20 | |
warming up | |
running mandelbrot(500) for 20 iterations | |
4.862 | |
4.822 | |
4.822 | |
4.846 | |
5.057 |
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
// Generated on 2013-12-28 using generator-angular 0.7.1 | |
'use strict'; | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' | |
// use this if you want to recursively match all subfolders: | |
// 'test/spec/**/*.js' | |
var proxySnippet = require('grunt-connect-proxy/lib/utils').proxyRequest; |
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
require 'ostruct' | |
class DeepStruct < OpenStruct | |
def initialize(hash=nil) | |
@table = {} | |
@hash_table = {} | |
@array = [] | |
if hash |
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
plain | |
torqbox -b 0.0.0.0 -e production -p 9292 | |
wrk -t20 -c100 -d10s http://0.0.0.0:9292/ | |
Running 5s test @ http://0.0.0.0:9292/ | |
20 threads and 100 connections | |
Thread Stats Avg Stdev Max +/- Stdev | |
Latency 1.61ms 468.01us 19.73ms 91.11% | |
Req/Sec 3.27k 264.78 5.00k 71.26% |