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
#!/bin/bash | |
# extract all postgres databases from a sql file created by pg_dumpall | |
# this script outputs one .sql file for each database in the original .sql file | |
# unless you pass the name of a database in the dump | |
if [ $# -lt 1 ] | |
then | |
echo "Usage: $0 <postgresql sql dump> [dbname]" >&2 | |
exit 1 | |
fi |
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
#!/bin/bash | |
# node-reinstall | |
# credit: http://stackoverflow.com/a/11178106/2083544 | |
## program version | |
VERSION="0.0.13" | |
## path prefix | |
PREFIX="${PREFIX:-/usr/local}" |
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
# This is just a cheat sheet: | |
# On production | |
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
# On local | |
scp -C production:~/database.sql.gz | |
dropdb database && createdb database | |
gunzip < database.sql.gz | psql database |
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
tell application "System Events" | |
tell security preferences | |
set require password to wake to true | |
end tell | |
end tell | |
activate application "ScreenSaverEngine" |
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
# GH | |
# by Brock Angelo | |
# for Mac OSX & Unix | |
# https://gist.github.com/1917716 | |
# Description: when you are on the command line and want to open your project in Github, just type "gh". Latest version opens the current branch on github as well. | |
# | |
# SETUP: | |
# 1. Copy this snippet to ~/bin/gh | |
# 2. Make it executable by running: chmod +x ~/bin/gh | |
# 3. From the command line, inside your project, type gh and the browser window will open. |
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
#!/bin/zsh | |
# aliascheck by @brock | |
# Description: checks each zsh command and reminds you if you already have an alias for that command | |
# Instructions: | |
# copy aliascheck.sh to ~/bin/aliascheck | |
# chmod +x ~/bin/aliascheck | |
# uncomment or modify line 14 below to source your aliases | |
# add the following to your ~/.zshrc or zsh profile: | |
# | |
# preexec() { zsh $(which aliascheck) $1} |
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
<TaskerData sr="" dvi="1" tv="4.6u3m"> | |
<Profile sr="prof21" ve="2"> | |
<cdate>1421280614090</cdate> | |
<edate>1421295126863</edate> | |
<id>21</id> | |
<mid0>19</mid0> | |
<nme>Go Home</nme> | |
<Event sr="con0" ve="2"> | |
<code>3001</code> | |
<pri>0</pri> |
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
# ----------------------------------------------------------------------------- | |
# FILE: smt-mod.zsh-theme | |
# DESCRIPTION: oh-my-zsh theme file, based on smt by Stephen Tudor | |
# AUTHOR: Brock Angelo | |
# VERSION: 0.1 | |
# SCREENSHOT: | |
# ----------------------------------------------------------------------------- | |
MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}" | |
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" |
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
#!/bin/bash | |
# GROOT! v 1.0.0 | |
# Install in your dotfiles, .bashrc, .zshrc or similar | |
# No more cd ../../../../.. to get to the root of a git project | |
# Running the command "groot" will look for the closest .git directory and take you there. | |
# Note that it doesn't traverse up the tree, it takes you directly to the directory with a .git in it... | |
# ...so the command `cd -` takes you back to where you were. | |
# Works with *some* submodules (depending on how your submodule was setup - as a file or a dir) | |
# If you are using submodules, you should be able to figure out how to modify this. |
NewerOlder