Skip to content

Instantly share code, notes, and snippets.

View RobWu's full-sized avatar

Robin Wunderlin RobWu

View GitHub Profile
@chuckbjones
chuckbjones / deploy.rb
Created August 22, 2012 07:51
Generate static html files at deploy time in Rails 3.x
# define a method to run rake tasks
def run_rake(task, options={}, &block)
rake = fetch(:rake, 'rake')
rails_env = fetch(:rails_env, 'production')
command = "cd #{current_path} && #{rake} #{task} RAILS_ENV=#{rails_env}"
run(command, options, &block)
end
@dipth
dipth / regex
Created July 30, 2011 18:06
Nykredit -> Freeagent
Use this regular expression to convert the exported csv-files from Nykredit to the csv-format required by FreeagentCentral.
Use the "convert commas to period", and "Omit headers" option when exporting from Nykredit.
Find: ^(\d{2})-(\d{2})-(\d{4});(.+?);(-?.+?);(N|J);(.+?);(\d{2}-\d{2}-\d{4})$
Replace: $1/$2/$3,$5,"$4"