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
Unsorted | |
[ | |
{number: 7, id: "abc"}, | |
{number: 1, id: "def"}, | |
{number: 4, id: "abc"}, | |
{number: 0, id: "def"}, | |
{number: 3, id: "abc"}, | |
{number: 5, id: "def"}, | |
{number: 6, id: "abc"}, |
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
cities.csv | |
city, state | |
charlotte, | |
raleigh, | |
boise, | |
chicago, | |
albany, | |
irvine, | |
austin, |
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::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. | |
/Users/christopherjbolton/.rbenv/versions/2.0.0-p353/bin/ruby extconf.rb | |
checking for main() in -lpthread... yes | |
checking for main() in -lobjc... yes | |
Warning! Unable to load libv8 ~> 3.16.14. | |
checking for v8.h... yes | |
creating Makefile | |
make "DESTDIR=" |
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
= f.input :state, as: :select, collection: [["All", ''], ["Pending", :pending], ["Active", :active]], include_blank: false, input_html: {value: params[:query].try(:[], :state)} |
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
has_many :public_photos, | |
-> { where(albums: {shared: 'public'})}, | |
order: "created_at DESC", | |
through: :albums, | |
class_name: Photo, | |
source: :photos |
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
# code | |
def take_turn(game, mark) | |
player_choice = get_player_choice | |
if game.positions.include? player_choice | |
self.turns << player_choice | |
game.print_turn(game.board, player_choice, mark) | |
game.reduce_positions(game.positions, player_choice) | |
else | |
puts "Please select one of the available positions. Which are #{game.positions}" |
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 zero | |
0 | |
end | |
def one | |
1 | |
end | |
def two | |
2 | |
end | |
def three |
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
Song has redemptions | |
Redemptions have multiple types. Redemptions have expiration dates. | |
Songs can also be deleted | |
I want to collect all Songs that are deleted OR that have one or more redemptions with a promoter type of 'promotion' that are not expired. | |
What I've got so far ... | |
Song.where( deleted_at: nil) |
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
{"id"=>68721, | |
"quicktime"=> | |
[{"name"=>"Teaser", | |
"sources"=> | |
[{"size"=>"480p", | |
"source"=> | |
"http://trailers.apple.com/movies/marvel/ironman3/ironman3-tlr1-m4mb0_h480p.mov"}, | |
{"size"=>"720p", | |
"source"=> | |
"http://trailers.apple.com/movies/marvel/ironman3/ironman3-tlr1-m4mb0_h720p.mov"}, |
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
available_funds = { | |
gifted_credits: 15, | |
earned_credits: 25, | |
purchased_credits: 35 | |
} | |
credits = available_funds.values.reduce(:+) | |
price = 50 | |
unless price > credits |
NewerOlder