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
pg_restore -l cr2.dump > db.list | |
# edit db.list | |
pg_restore --verbose --clean --no-acl --no-owner -h {HOST} -U {USER} -d {DATABASE} -L db.list cr2.dump |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
api "github.com/andybons/hipchat" | |
"github.com/daneharrigan/hipchat" | |
"github.com/joho/godotenv" | |
"os" | |
"strings" |
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
package main | |
import ( | |
"bufio" | |
"bytes" | |
"encoding/base64" | |
"fmt" | |
"io" | |
"io/ioutil" | |
// "log" |
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
class FavOptions < Array | |
def self.dump(ingredients) | |
ingredients ? ingredients.join(";") : nil | |
end | |
def self.load(ingredients) | |
ingredients ? new(ingredients.split(";")) : nil | |
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
time psql DBNAME -F , --no-align -c "SELECT * FROM TABLE" | gzip -9 > table_backup.gz |
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
# no find_all_by | |
grep -e "find_all_by" -r --include "*.rb" . | |
# no :conditions | |
grep -e ":conditions" -r --include "*.rb" . | |
# no naked scopes | |
grep -r -e "scope :" --include "*.rb" . | grep -v "lambda" | grep -v '\->' | |
# no naked default_scopes |
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
steps to squash and merge a lot running feature branch: | |
# on feature branch {guest-crm}, make a clean space to play | |
git checkout guest-crm | |
git checkout -b package-guest-crm | |
# here, find a commit before the first you want to use in the squash | |
git rebase -i 1f98b7a26a9874105 | |
# on this screen, keep the first commit as "pick", for everything below, switch pick to s or squash | |
# save |
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
https://github.com/eddorre/SublimeERB | |
https://github.com/wesf90/rails-partial | |
https://github.com/pavelpachkovskij/sublime-html-to-haml | |
https://github.com/sobstel/SyncedSideBar | |
rubocop (maybe, can be slow) |
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 head_status(u) | |
uri = URI(u) | |
Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http| | |
request = Net::HTTP::Head.new uri | |
response = http.request request # Net::HTTPResponse object | |
response.code | |
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
{ :admin => | |
{ | |
role: Role.create(name: 'admin'), | |
asdf: 'asdf' | |
} | |
:staff => | |
{ | |
} | |
:concierge => |