I hereby claim:
- I am simonrentzke on github.
- I am sren (https://keybase.io/sren) on keybase.
- I have a public key whose fingerprint is 7275 37F3 470D 5AA2 821A 8423 86F0 8926 4E26 07DB
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Badge.all.each {|l| l.update_attributes(image: Dragonfly.app.fetch_url("http://placekitten.com/800/#{800+rand(100)}")) } | |
Level.all.each {|l| l.update_attributes(image: Dragonfly.app.fetch_url("https://robohash.org/#{rand(100)}?set=3")) } |
#!/usr/bin/env ruby | |
# Dependencies | |
# - brew install hub | |
# - brew install ghi | |
# - ghi config --auth <gh username> | |
if ARGV.size != 1 | |
puts "USAGE: ./pr.rb <issue number>" |
mkdir rails-5-test-app | |
cd rails-5-test-app | |
touch .ruby-version | |
echo 'ruby-2.2.2' > .ruby-version | |
touch Gemfile | |
printf "source 'https://rubygems.org'\nruby '2.2.2'\n\n\ngem 'rails', github: 'rails/rails'\ngem 'arel', github: 'rails/arel'\ngem 'rack', github: 'rack/rack'" >> Gemfile | |
bundle | |
bundle exec rails new . --dev --force | |
bundle exec rails s |
function remove_selected_from_options(arr1, arr2) { | |
var filtered_options = []; | |
for (var i=0; i < arr1.length; i++) { | |
var included = false; | |
for (var z=0; z < arr2.length; z++) { | |
if (arr2[z][0] == arr1[i][0]) { | |
included = true; | |
break; | |
} | |
} |
!!! 5 | |
%html | |
%head | |
%title= "Your Website" | |
%meta{ :content => "", :name => "description" } | |
%meta{ :content => "", :name => "author" } | |
%meta{ :content => "3 days", :name => "revisit-after" } | |
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" } | |
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" } | |
%body |
module Mergeable | |
def merge_associated_records_and_destroy(throwaway_object, special_cases = {}) | |
#look for any fields that match field name | |
field_name_to_update = "#{self.class.to_s.downcase}_id" | |
Dir[Rails.root.to_s + '/app/models/**/*.rb'].each { |file| require(file)} | |
message = [] | |
models = ActiveRecord::Base.subclasses.collect | |
begin | |
models.each do |m| | |
if m.columns_hash["#{self.class.to_s.downcase}_id"] |
Factory.define :user_credit_card do |cc| | |
cc.card_type "bogus" | |
cc.card_number 1 | |
cc.verification_value "123" | |
cc.expiration_date Time.now + 1.year | |
end |
if CruiseControl::invoke_rake_task 'spec' | |
puts "Pushing on heroku... [Start]" | |
`git push heroku master` | |
puts "Pushed on heroku. [Done]" | |
puts "Running migrations... [Start]" | |
`heroku rake db:migrate` | |
puts "Migrated... [Done]" | |
puts "Prepare test db... [Start]" | |
`heroku rake db:test:prepare` | |
puts "Test database ready [Done]" |
To remove vendor and public directories in textmate project (if it is loading too slow). | |
Click [i] in the tray, and edit the root folder pattern to this: | |
!.*/(\.[^/]*|public|vendor|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$ |