# env.rb or spec_helper.rb
Capybara.register_driver :poltergeist do |app|
opts = {
extensions: ["#{Rails.root}/features/support/phantomjs/disable_animations.js"] # or wherever
}
Capybara::Poltergeist::Driver.new(app, opts)
end
View keybase
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
### Keybase proof | |
I hereby claim: | |
* I am andyjbas on github. | |
* I am andyjbas (https://keybase.io/andyjbas) on keybase. | |
* I have a public key whose fingerprint is 19BC E9F2 DD9B 539E 74DF B057 9D97 AC59 EA27 12EC | |
To claim this, I am signing this object: |
View gist:f0001ca8304d6b381e41
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
http://www.testflightapp.com/install/da6b118ced23896df5cf2bfbef91706f-MTIwNTI2OTU/ |
View gist:9962218
View gist:4733732
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
array = ["andy", "eric", "bloc"] | |
array.each_with_index do |element, index| | |
puts "The index of #{element} is #{index}" | |
end | |
# => The index of andy is 0 | |
# => The index of eric is 1 | |
# => The index of bloc is 2 |
View gist:4700490
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 FutureValue | |
def initialze | |
end | |
def annual(rate, years, annual_contribution=0, initial_investment) | |
pv = self.pv(rate, annual_contribution, years, initial_investment) | |
pv * (1 + rate)**years | |
end | |
# where R is the periodic yield, A is the periodic payment, |
View gist:4698761
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
// grab new items html | |
var newItems = "<%= j render(partial: 'endless_append', locals: { items: @feed_items }) %>"; | |
// fetch the scroll position | |
// used to set the window location back after below hack | |
var scroll_position = $(window).scrollTop(); | |
// append new items to isotope, as usual | |
$("#feed_list").append( newItems ); |
View gist:4670925
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
function Car( model, year, miles ) { | |
this.model = model; | |
this.year = year; | |
this.miles = miles; | |
} | |
// Note here that we are using Object.prototype.newMethod rather than |
View gist:4670921
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
function Car( model, year, miles ) { | |
this.model = model; | |
this.year = year; | |
this.miles = miles; | |
} | |
// Note here that we are using Object.prototype.newMethod rather than |
View gist:4617448
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
$("#feed").on("click", ".multicheck", function(e) { | |
$(this).toggleClass("checked"); | |
toggleSorting(this); | |
return false; | |
}); |
View gist:4588121
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 RPNCalculator | |
attr_accessor :stack | |
def initialize | |
self.stack = Array.new | |
end | |
def push(val) | |
self.stack.push(val.to_f) | |
end |
NewerOlder