psql -h <hostname> -U <user> <db> # db is optional
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
| find /usr/local/Cellar | grep bin/ > ./usr_bin_local | |
| ruby -ne "s=\$_; p=s.match(/\/bin\/(.+)/); b=p[1] unless p.nil?; cmd=%Q(ln -s #{s.chomp} /usr/local/bin/#{b});`#{cmd}`" ./usr_bin_local |
sudo launchctl unload /Library/LaunchDaemons/com.edb.launchd.postgresql-x.x.plist
sudo rm -f /Library/LaunchDaemons/com.edb.launchd.postgresql-x.x.plistsudo cp /usr/local/opt/nginx/homebrew.mxcl.nginx.plist /Library/LaunchDaemons/with a hat tip to Sublime Text 2 Shortcuts
| ⌘; | autocomplete |
| ⌘⌥B | instant replay |
| ⌘⌥E | search across all tabs |
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
| # Automatically adds branch name and description to every commit message. | |
| # | |
| DESCRIPTION=$(git config branch."$NAME".description) | |
| if ! [[ $@ == *HEAD* ]] then | |
| NAME=$(git branch | grep '*' | sed 's/* //') | |
| echo "$NAME"': '"`cat "$1"`" > "$1" | |
| fi | |
| if [ -n "$DESCRIPTION" ] then |
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
| AllCops: | |
| RunRailsCops: true | |
| Style/Encoding: | |
| Enabled: false | |
| Style/AsciiComments: | |
| Enabled: false | |
| Lint/AssignmentInCondition: |
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
| class LunchList | |
| NAMES = %i(DimaS DimaG Denis SergeyStat SergeyAdm Oleg Alena).shuffle | |
| MIN_EATERS = 3 | |
| MAX_EATERS = 4 | |
| def generated_list | |
| decisions = {} | |
| NAMES.map do |name| | |
| decisions[name] = rand(0..1).zero? ? 'wait' : 'go!' | |
| end |
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
| class SessionCookieGenerator | |
| def self.generate user_obj | |
| new(user_obj).generate | |
| end | |
| def initialize user_obj | |
| @user = user_obj | |
| @cookie = {} | |
| @session = {'rack.session' => {}} | |
| end |
OlderNewer