Skip to content

Instantly share code, notes, and snippets.

# don't forget chmod +x ~/.zsh/git-prompt.zsh
suppress_errors() {
# Syntactic sugar to ignore any errors. I created it because I can never
# remember that 2> represents stderr.
eval "$1" 2>/dev/null
}
git_prompt() {
# Colors lifted from https://www.nordtheme.com/docs/colors-and-palettes

Keybase proof

I hereby claim:

  • I am pwiesner on github.
  • I am pwiesner (https://keybase.io/pwiesner) on keybase.
  • I have a public key whose fingerprint is ACA0 A6A1 793E EA0F DE1F 7643 789C 8D47 78D5 4825

To claim this, I am signing this object:

@pwiesner
pwiesner / gist:2ee081d3f3b3d363c724
Created February 18, 2016 21:43
List all remote branches sorted by their most recent commit date
git for-each-ref --sort=-committerdate refs/remotes/ --format='%(committerdate:iso8601) %(refname:short)'
/*
* A while back I overheard one of my coworkers grumbling about converting 15 digit salesforce ids to their
* 18 digit variant. I had no idea what he was talking about, but goolge and Alan Shanahan did. Below is my
* attempt at implementing the algorithm Alan described in this blog post
* https://astadiaemea.wordpress.com/2010/06/21/15-or-18-character-ids-in-salesforce-com-%E2%80%93-do-you-know-how-useful-unique-ids-are-to-your-development-effort/
*
* The following code has not been used anywhere or really tested for that matter. I just wanted to better
* understand what was being discussed on the other side of my cube.
*/
@pwiesner
pwiesner / gist:3f9f3607d1bc8a811e02
Created March 23, 2015 03:06
Boxstarter for win10 vm
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
cinst fiddler4
cinst sublimetext3
cinst poshgit
cinst dotpeek
@pwiesner
pwiesner / find_column.sql
Last active December 26, 2015 09:08
Search SqlServer for a column with a specific name
--BEGIN
SELECT
SCHEMA_NAME(schema_id) AS schema_name,
t.name AS table_name,
c.name AS column_name
FROM
sys.tables AS t
INNER JOIN
sys.columns c
ON
@pwiesner
pwiesner / gist:5670800
Last active December 17, 2015 20:49
download the most recent database backup from heroku
#replace APP-NAME with your applications name
curl -o tmp/APP-NAME-$(date "+%Y%m%d").dump `heroku pgbackups:url --app APP-NAME`