Skip to content

Instantly share code, notes, and snippets.

@guildencrantz
guildencrantz / XCode .gitignore
Created July 4, 2010 21:51
XCode .gitignore
_Store
*.swp
*~.nib
._*
build/
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
@guildencrantz
guildencrantz / C# Operating System Check
Created July 8, 2010 21:09
C# Operating System runtime version check
C# (Mono and .Net) Operating System runtime version check: parse Environment.OSVersion.ToString().
http://www.developmentnow.com/g/36_2003_12_0_0_203951/Detecting-OS-mono-NET.htm
@guildencrantz
guildencrantz / List Oracle Tables
Last active September 5, 2015 11:25
Listing Oracle tables
SELECT * FROM all_tables; <- all tables you have access to
SELECT * FROM user_tables; <- all tables owned by currently logged in user
SELECT * FROM dba_tables; <- all tables in database
And, to desc a table through jdbc:
select COLUMN_NAME, DATA_TYPE, DATA_LENGTH, NULLABLE from USER_TAB_COLUMNS where TABLE_NAME='mytable' order by column_id;
@guildencrantz
guildencrantz / KeePass 2 Target Window Regex (Prod)
Created September 2, 2010 17:44
KeePass Auto-Type Window Target: Only match production shells where I'm currently the active user.
//(?<!((int)|(tst)|(dev))((\.lan)|(\.dfs))?)\.returnpath\.net\(mhenkel\)://
@guildencrantz
guildencrantz / Bash Default Variable Value
Created September 18, 2010 18:17
Bash Default Variable Value
output=${1-text}
echo $output
@guildencrantz
guildencrantz / vimrc save scripts as executable
Created November 22, 2010 20:35
Automatically marks files which start with a shebang (or contain /bin/ on the first line) as executable when they're saved in vim.
au BufWritePost * if getline(1) =~ "^#!" | if getline(1) =~ "/bin/" | silent !chmod +x <afile> | endif | endif
@guildencrantz
guildencrantz / Delete overwrites
Created March 7, 2011 23:21
Find non-unique renders and delete all but the last one
grep "X-MailPolish: " */header.txt | awk '{ print $2; }' | uniq -d | xargs -I{} grep -l -m 1 {} */header.txt | xargs -I{} dirname {} | xargs | awk '{ for (i=1; i<NF; i++) { print "deleting " $i; system("sudo rm -rf " $i); }}'
@guildencrantz
guildencrantz / Watch Render Queues
Created March 7, 2011 23:43
Monitor render queues, updating every second and sorting by queue depth in descending order
for i in *; do echo $i " " `ls -1 $i/new | wc -l`; done | sort -nrk 2
@guildencrantz
guildencrantz / gist:976812
Created May 17, 2011 16:36
Vim: Elevate privileges with sudo while saving a file
:w !sudo tee %
@guildencrantz
guildencrantz / .bashrc
Created August 26, 2011 17:13
Command Prompt with time and git branch
PS1="\n\[\e[0m\][\[\e[32m\]\u\[\e[0m\]@\[\e[36m\]\h\[\e[0m\] \[\e[35m\](\t)\[\e[0m\]:\[\e[33m\]\w\[\e[0;31m\]\$(__git_ps1 ' (%s)')\[\e[0m\]]\n\\$ "