Skip to content

Instantly share code, notes, and snippets.

View why-el's full-sized avatar

Mohamed Wael Khobalatte why-el

View GitHub Profile
@why-el
why-el / rails-money-issue-239.rb
Created November 16, 2014 17:15
Rails-money issue 239
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 August 29, 2015 14:09
money-rails's `t.money` syntax working with Rails.4.2.beta4
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 October 19, 2014 17:59
Reproduction script for Rails issue 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 August 29, 2015 14:06
rails_issue_14178.rb
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'
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 June 14, 2013 21:27
Get all Moroccan cities from French Wikipedia.
# 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 December 16, 2012 11:00
Save mixest.com songs to local history. Assumes mixest is playing in the first tab, for now. Works like a charm with Alfred.
tell application "Google Chrome"
execute front window's first tab javascript "document.getElementById('lovebutton').click();"
end tell