Skip to content

Instantly share code, notes, and snippets.

View pablojimeno's full-sized avatar
🔬
learning

Pablo Jimeno pablojimeno

🔬
learning
View GitHub Profile
@pablojimeno
pablojimeno / template.rb
Created September 29, 2011 10:31 — forked from BinaryMuse/template.rb
My Rails application template - under development! See comments for info.
# ============================================================================
# Info class
# ============================================================================
class ApplicationInfo < Rails::Generators::AppGenerator
attr_reader :notices, :errors, :options, :data
def initialize
@notices = [] # Array of notices to display to the user at the end
@errors = [] # Array of errors to display to the user at the end
@options = [] # Array of options selected throughout the template
source "http://rubygems.org"
gem "cucumber"
gem "capybara"
gem "capybara-webkit", :platforms => [:ruby], :require => false, :git => "git://github.com/thoughtbot/capybara-webkit.git"
gem "capybara-mechanize", :git => "git://github.com/jeroenvandijk/capybara-mechanize.git"
gem "rspec"
gem "rake"
@pablojimeno
pablojimeno / README.md
Created September 13, 2013 07:28 — forked from netmute/README.md

Game of Life

An implementation of Conway's Game of Life in 140 characters of Ruby.

Author

Created by Simon Ernst (@sier).

namespace :db do
desc "Download the a full dump of the production database into the development database"
task :pull do
config = YAML::load(File.open(File.join('config', 'database.yml')))
dump_database_remotely(config['production'], remote_file)
compress_backup_remotely(remote_file)
download_backup(remote_file(:compressed), local_file(:compressed))
# This is a basic example how to create an import from csv data. This could
# be called in a rake task:
namespace :db do
namespace :import do
desc "Import customer of old shop from csv"
task :customer => :environment do
csv_file = 'db/customer_data.csv'
importer = Import::ImportCustomer.new(IO.read(csv_file))
importer.import
@pablojimeno
pablojimeno / irb3.rb
Created January 13, 2014 21:18 — forked from peterc/irb3.rb
#!/usr/bin/env ruby
# encoding: utf-8
# irb3 - Runs an IRB-esque prompt (but it's NOT really IRB!) over multiple
# versions of Ruby at once (using RVM)
#
# By Peter Cooper, BSD licensed
#
# Main dependency is term-ansicolor for each impl:
# rvm exec gem install term-ansicolor
* Only the releases of the stable versions are enumerated in principle. The releases of the unstable versions especially considered to be important are indicated as "not stable."
* The branches used as the source of each releases are specified, and the branching timing of them are also shown. BTW, before subversionizing of the repository, the term called "trunk" was not used, but this list uses it in order to avoid confusion.
* In order to show a historical backdrop, big conferences (RubyKaigi, RubyConf and Euruko) are also emurated. About the venues of such conferences, general English notations are adopted, in my hope.
* ruby_1_8_7 branch was recut from v1_8_7 tag after the 1.8.7 release becaouse of an accident.
* 1.2.1 release was canceled once, and the 2nd repelase called "repack" was performed. Although there were other examples similar to this, since the re-releases were performed during the same day, it does not write clearly in particular.
* Since 1.0 was released with the date in large quantities
-- from http://www.tuaw.com/2011/03/14/use-applescript-to-open-current-safari-url-in-google-chrome/
-- install FastScripts http://www.red-sweater.com/fastscripts/ and place this AppleScript in the Scripts applications folder for Google Chrome.
-- For me that was ~/Library/Scripts/Applications/Safari
-- You can then assign it a keyboard shortcut. I went with Cmd-Shift-C
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
tell application "Google Chrome"
# MOTIVATION: As rails apps are growing, people are noticing the drawbacks
# of the ActiveRecord pattern. Several apps I have seen, and several
# developers I have spoken to are looking towards other patterns for object
# persistence. The major drawback with ActiveRecord is that the notion
# of the domain object is conflated with what it means to store/retrieve
# it in any given format (like sql, json, key/value, etc).
#
# This is an attempt to codify the Repository pattern in a way that would
# feel comfortable to beginner and seasoned Ruby developers alike.
#
@pablojimeno
pablojimeno / gist:1a5275d9dbb692338607
Last active August 29, 2015 14:27 — forked from aitor/gist:4111994
List of female scientists before the 20th century
Extracted from http://en.wikipedia.org/wiki/List_of_female_scientists_before_the_21st_century
Aglaonike (2nd century BCE), the first woman astronomer in Ancient Greece
Agnodike (4th century BCE), the first woman physician to practice legally in Athens
Arete of Cyrene (5th–4th centuries BCE), natural and moral philosopher, North Africa
Artemisia of Caria (c. 300 BCE), botanist
Aspasia of Miletus (4th century BCE), philosopher and scientist
Cleopatra the Alchemist - identity is unclear, but her book, The Chrysopoeia of Cleopatra, is[1] first recorded as existing in the 2nd century A.D./C.E. in Alexandria.
Diotima of Mantinea (4th century BCE), philosopher and scientist, ancient Greece (sources vary as to her historicity; possibly a fictionalized character based on Aspasia of Miletus)
Enheduanna (c. 2285–2250 BCE), Sumerian/Akkadian astronomer and poet