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
# Example integration spec for a Rake task in Rails | |
# | |
# cat <<EOT > lib/tasks/myapp.rake | |
# namespace :myapp do | |
# task :mytask => :environment do | |
# puts "Hello" | |
# end | |
# end | |
# EOT |
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
echo -n "3pm Christmas Day in LA in local timezone: " | |
date --date 'TZ="America/Los_Angeles" 2016-12-25T15:00' | |
echo -n "3pm Christmas Day in LA in London: " | |
TZ="Europe/London" date --date 'TZ="America/Los_Angeles" 2016-12-25T15:00' |
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
# | |
# Example of how to convert CSV data on read, in this case parsing | |
# some JSON in a CSV. | |
# | |
require 'csv' | |
require 'json' | |
csv = <<EOT | |
id,json_stuff | |
1,"{""foo"":""bar""}" |
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 'sequel' | |
require 'logger' | |
DB = Sequel.sqlite(loggers: [Logger.new(STDOUT)]) | |
DB.create_table :authors do | |
primary_key :id | |
String :name | |
end |
OlderNewer