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 Version = function (major, minor, patch) { | |
this.major = major | |
this.minor = minor | |
this.patch = patch | |
} | |
Version.prototype.toString = function () { | |
return [this.major, this.minor, this.patch].join(".") | |
} |
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 ruby | |
%w(uri logger rubygems redis childprocess).each do |dep| | |
begin | |
require dep | |
rescue LoadError | |
puts "The #{dep} gem could not be loaded! Try running: gem install #{dep}" | |
end | |
end |
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
#!/bin/bash | |
unicorn_start() { | |
if ! unicorn_is_running ; then | |
echo "Unicorn Starting, Type: ${APP_TYPE} interface, App Name: ${application}" | |
if [[ $APP_TYPE == "rails" ]] ; then | |
bundle exec $UNICORN_EXEC -E $RAILS_ENV -c $UNICORN_CONF -D | |
unicorn_status=$? | |
else | |
bundle exec $UNICORN_EXEC -E $RACK_ENV -c $UNICORN_CONF -D /data/${application}/current/config.ru | |
unicorn_status=$? |
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
Feature: Table persistence | |
Scenario: We try to modify a table and it keeps its changes when we pass it to another step | |
When we have the following table and then set an arbitrary value inside the step definition | |
| one | 1 | | |
| fizz | buzz | | |
Then the table should retain this modification when passed to another step |
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
// Assuming jQuery in $ | |
if ($.browser.msie && parseInt($.browser.version, 10) === 8)) { | |
// do stuff | |
} |
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
# Usage example | |
require "inspect_middleware" | |
use InspectMiddleware | |
run GenericSinatraApp |
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
source :rubygems | |
gem "eventmachine" | |
gem "em-synchrony", :require => "em-synchrony" | |
gem "em-http-request", :require => "em-http" |
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
┌─[damien@Thor] - [~/src/em-http-request] - [Wed Dec 15, 11:26] | |
└─[$]> autotest | |
loading autotest/rspec2 | |
bundle exec /Users/damien/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S /Users/damien/.rvm/gems/ruby-1.9.2-p0@em-http-request/gems/rspec-core-2.0.1/bin/rspec --autotest '/Users/damien/src/em-http-request/spec/encoding_spec.rb' '/Users/damien/src/em-http-request/spec/mock_spec.rb' '/Users/damien/src/em-http-request/spec/multi_spec.rb' '/Users/damien/src/em-http-request/spec/request_spec.rb' | |
......F...........F..............................................F................. | |
Failures: | |
1) EventMachine::HttpEncoding should be fast on long string escapes | |
Failure/Error: (Time.now - s).should be_close(1, 0.5) | |
expected 1 +/- (< 0.5), got 0.481466 |
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
(function($) { | |
$.fn.cloneableFields = function() { | |
return this.each(function() { | |
var container = $(this); | |
var fields = container.find('li:last'); | |
var label = 'Add another ' + fields.find('label').text(); | |
container.count = function() { | |
return this.find('li').size(); | |
}; |
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
┌─[damien@protos] - [~/.vim] - [Tue Aug 24, 05:00] | |
└─[$] <git:(master*)> <rvm:(ruby-1.9.2)> rake zoomwin --trace | |
(in /Users/damien/.vim) | |
** Invoke zoomwin (first_time) | |
** Execute zoomwin | |
**************************************** | |
* Installing zoomwin * | |
**************************************** |