View .buildpacks
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
https://github.com/peterkeen/heroku-buildpack-vendorbinaries.git | |
https://github.com/aaronrenner/heroku-buildpack-rgeo-prep.git | |
https://github.com/kr/heroku-buildpack-inline.git | |
https://github.com/heroku/heroku-buildpack-ruby.git |
View application-ie.coffee
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 jquery | |
#= require application.js |
View some_spec.rb
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
def trigger(selector, name, options={}) | |
# if you return the default object capybara tries to parse the jquery object | |
page.evaluate_script("$('#{selector}').trigger(jQuery.Event('#{name}', #{options.to_json})); undefined") | |
end | |
it 'triggers a couple events' do | |
# Ex: lets simulate a drag and drop | |
trigger '.canvas', :mousedown, {pageX:200, pageY:300} | |
trigger '.canvas', :mousemove, {pageX:400, pageY:400} | |
trigger '.canvas', :mouseup |
View _pems.scss
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
/* See http://mrdanadams.com/2012/pixel-ems-css-conversion-sass-mixin/ */ | |
/* Default font size in pixels if not overridden. */ | |
$baseFontSize: 16; | |
/* Convert PX units to EMs. | |
Ex: margin-right: pem(16); | |
*/ | |
@function pem($pxval, $base: $baseFontSize) { | |
@return #{$pxval / $base}em; |
View controller_spec.rb
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
# do our update | |
@controller.record_votes(winner._id.to_s, loser._id.to_s) | |
# will this pass or fail? who knows!? | |
Item.count(conditions:{ votes:1 }).should == 0 |
View controller.rb
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
# Records the vote against 2 items. | |
# Both parameters are strings | |
def record_votes(winner_id, loser_id) | |
# grab the connection from the underlying driver | |
db = Mongoid::Config::master | |
# a future improvement would be to store this away somewhere, perhaps as a constant | |
# note: javascript comments added for the post: they are not in the real code | |
f = """ | |
function(winner_id, loser_id) { |
View Gemfile
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 'sunspot_rails' | |
gem 'kaminari' | |
gem 'sunspot_with_kaminari' |
View controller.rb
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
ids = current_user.facebook_friends if current_user | |
@search = Profile.solr_search do | |
keywords params[:q] do | |
boost_fields name: 10.0, user: 4.0 | |
end | |
unless ids.blank? | |
adjust_solr_params do |params| | |
# See "bq (boost query)" in http://wiki.apache.org/solr/DisMaxQParserPlugin | |
params[:bq] = "facebook_id_s:(#{ids.join(' OR ')})^10" |
View application.js
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() { | |
/* Convenience for forms or links that return HTML from a remote ajax call. | |
The returned markup will be inserted into the element id specified. | |
*/ | |
$('form[data-update-target]').live('ajax:success', function(evt, data) { | |
var target = $(this).data('update-target'); | |
$('#' + target).html(data); | |
}); | |
}); |
View scale.scss
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
@mixin scale($props, $sizes, $base: 16) { | |
$values: (); | |
$sublists: false; | |
@each $s in $sizes { | |
/* unwrap lists for values that have multiple list of values such as text-shadow */ | |
@if type-of($s) == list { | |
$sublists: true; | |
$vv: (); | |
@each $ss in $s { | |
$vv: append($vv, if(type-of($ss) == number, #{$ss / $base}em, $ss)); |
NewerOlder