My daughter and I love playing problem-solving games together. After completing a few I asked for recommendations on Twitter. Here's the list.
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
(defun copy-to-hipchat () | |
"Adds /code to the region copied" | |
(interactive) | |
(kill-ring-save (region-beginning) (region-end)) | |
(kill-append "/code " t)) |
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
require 'spreadsheet' | |
book = Spreadsheet.open '/path/to/an/fichero.xls' | |
# Para acceder a las páginas: | |
book.worksheets | |
# Para acceder a una página en concreto | |
sheet1 = book.worksheet 0 | |
sheet2 = book.worksheet 'Sheet1' |
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
ruby script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git | |
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 valid_email? | |
TMail::Address.parse(email) | |
rescue | |
errors.add_to_base("Must be a valid email") | |
end |
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
ActionMailer::Base.smtp_settings = { | |
:tls => true, | |
:address => "smtp.gmail.com", | |
:port => "587", | |
:domain => "YOURDOMAIN", | |
:authentication => :plain, | |
:user_name => "GOOGLEUSERNAME", | |
:password => "GOOGLEPASSWORD" | |
} |
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
application/activemessage | |
application/andrew-inset | |
application/applefile | |
application/atom+xml | |
application/atomicmail | |
application/batch-smtp | |
application/beep+xml | |
application/cals-1840 | |
application/cnrp+xml | |
application/commonground |
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
# Add a bunch of twitter users to one of your twitter lists | |
# | |
# use it with a file full of twitter usernames | |
# one name by line | |
# | |
# If the listname indicated doesn't exist it will be created | |
# | |
# Example: $ ruby twitter_lists.rb 'username' 'userpass' 'listname' twitter_users.txt | |
# | |
# Debug mode: $ ruby twitter_lists.rb 'username' 'userpass' 'listname' twitter_users.txt debug |
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 do_destroy | |
destroy_find_record | |
begin | |
self.successful = @record.destroy | |
rescue Exception => ex | |
flash[:warning] = "Your message here" | |
self.successful = false | |
end | |
end |
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
require 'rubygems' | |
require 'sinatra' | |
require 'redis' | |
# To use, simply start your Redis server and boot this | |
# example app with: | |
# ruby example_note_keeping_app.rb | |
# | |
# Point your browser to http://localhost:4567 and enjoy! | |
# |
OlderNewer