This file contains hidden or 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
# frozen_string_literal: true | |
module DbTransactionAdapter | |
# Add the ability to wrap number of steps into database transaction | |
# | |
# @example | |
# db_transaction, :db do | |
# step :validate | |
# check :clear | |
# step :create # failure here will rollback previous side effects |
This file contains hidden or 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
cat blah.csv | cut -f1 -d , | uniq -d |
This file contains hidden or 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
[mergetool "p4merge"] | |
cmd = /Applications/p4merge.app/Contents/MacOS/p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED" | |
keepTemporaries = false | |
trustExitCode = false | |
keepBackup = false | |
[merge] | |
tool = p4merge |
This file contains hidden or 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
ls | sed -n "p;N;" | xargs rm -r | |
#remove spaces from file | |
for file in *;do mv $file ${file// /};done |
This file contains hidden or 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 'active_record' | |
require 'fileutils' | |
namespace :db do | |
desc "loads database configuration in for other tasks to run" | |
task :load_config do | |
ActiveRecord::Base.configurations = db_conf | |
ActiveRecord::Base.establish_connection db_conf | |
end |