Skip to content

Instantly share code, notes, and snippets.

Avatar

Mohamed Wael Khobalatte why-el

View GitHub Profile
View rails-money-issue-239.rb
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', '4.2.0.beta4'
gem 'pg'
gem 'money-rails'
GEMFILE
system 'bundle'
end
@why-el
why-el / money-rails-t-money.rb
Last active Aug 29, 2015
money-rails's `t.money` syntax working with Rails.4.2.beta4
View money-rails-t-money.rb
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', '4.2.0.beta4'
gem 'pg'
gem 'money-rails'
GEMFILE
system 'bundle'
end
@why-el
why-el / 17325
Created Oct 19, 2014
Reproduction script for Rails issue 17325
View 17325
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'devise', github: 'plataformatec/devise'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
GEMFILE
@why-el
why-el / gist:564ec9a8b1a415e94fca
Last active Aug 29, 2015
rails_issue_14178.rb
View gist:564ec9a8b1a415e94fca
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'rack', github: 'rack/rack'
gem 'i18n', github: 'svenfuchs/i18n'
GEMFILE
system 'bundle'
View gist:9508872
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', '4.1.0.rc1'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@why-el
why-el / moroccan_cities.rb
Created Jun 14, 2013
Get all Moroccan cities from French Wikipedia.
View moroccan_cities.rb
# This will output all Moroccan cities (including some that are not
# recognized internationally) in a text file called, well,
# moroccan_cities.txt.
require 'nokogiri'
require 'open-uri'
# This should not be relied on. Get the list once and be done with it.
url = "https://fr.wikipedia.org/wiki/Villes_du_Maroc"
@why-el
why-el / gist:4306340
Created Dec 16, 2012
Save mixest.com songs to local history. Assumes mixest is playing in the first tab, for now. Works like a charm with Alfred.
View gist:4306340
tell application "Google Chrome"
execute front window's first tab javascript "document.getElementById('lovebutton').click();"
end tell