Skip to content

Instantly share code, notes, and snippets.

Problem-Solving Games

My daughter and I love playing problem-solving games together. After completing a few I asked for recommendations on Twitter. Here's the list.

Completed

@towanda
towanda / copy-to-hipchat.el
Last active August 29, 2015 14:01
Copy code to hipchat
(defun copy-to-hipchat ()
"Adds /code to the region copied"
(interactive)
(kill-ring-save (region-beginning) (region-end))
(kill-append "/code " t))
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'
ruby script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git
def valid_email?
TMail::Address.parse(email)
rescue
errors.add_to_base("Must be a valid email")
end
ActionMailer::Base.smtp_settings = {
:tls => true,
:address => "smtp.gmail.com",
:port => "587",
:domain => "YOURDOMAIN",
:authentication => :plain,
:user_name => "GOOGLEUSERNAME",
:password => "GOOGLEPASSWORD"
}
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
# 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
def do_destroy
destroy_find_record
begin
self.successful = @record.destroy
rescue Exception => ex
flash[:warning] = "Your message here"
self.successful = false
end
end
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!
#