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
| # SQLite version 3.x | |
| # gem install sqlite3 | |
| # | |
| # Ensure the SQLite 3 gem is defined in your Gemfile | |
| # gem 'sqlite3' | |
| development: | |
| adapter: sqlite3 | |
| database: db/development.sqlite3 | |
| pool: 5 | |
| timeout: 5000 |
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 say(phrase, language){ | |
| return function(callback){ | |
| console.log("saying " + phrase); | |
| var audio = new Audio("http://tts.lingal.org/?tl=" + language + "&q=" + phrase); | |
| audio.addEventListener('ended', wrapped(callback)); | |
| audio.play(); | |
| } | |
| } |
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
| Lingal.SayItPlayer = Ember.View.extend({ | |
| game:null, | |
| didInsertElement:function(){ | |
| queue = async.queue(function(job, next){ | |
| job(next); | |
| }, 1); | |
| function wrapped(callback){ |
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
| module Reports | |
| module CauseCumulativeCommission | |
| extend self | |
| def build(name, cause, opts=ReportOptions.new) | |
| { | |
| :name => name, | |
| :columns => [['date', 'Date'], ['number', cause.name]], | |
| :rows => begin | |
| (opts.start_date..opts.end_date).step.inject([]) do |rows, date| |
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
| (1..100).each do|n| | |
| text = "Fizz" if n % 3 == 0 | |
| text = "#{text}Buzz" if n % 5 == 0 | |
| puts text || n | |
| 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
| function regex { gawk 'match($0,/'$1'/, ary) {print ary['${2:-'0'}']}'; } |
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 decode { ruby -e 'require "cgi"; while gets; puts CGI::unescape($_); 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
| VCR.config do |c| | |
| c.cassette_library_dir = 'features/vcr_cassettes' | |
| end | |
| Spinach.hooks.before_scenario do |scenario| | |
| cassette_name = "#{scenario.feature.name.parameterize.underscore}/#{scenario.name.parameterize.underscore}" | |
| VCR.insert_cassette(cassette_name, :record => :once) | |
| end | |
| Spinach.hooks.after_scenario do |scenario| |
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
| gem 'https://github.com/archiloque/rest-client' |
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 getData = function(callback){ | |
| showLoadingScreen(); | |
| $.ajax("http://someurl.com", { | |
| complete: function(data){ | |
| hideLoadingScreen(); | |
| callback(data); | |
| } | |
| }); | |
| }; |