Skip to content

Instantly share code, notes, and snippets.

Don't chain ternary operators, otherwise if it compiles it's fair game
@ncremins
ncremins / Purge Downloads
Created November 1, 2013 21:37
Apple script to purge downloads, this can be easily set up in automator to run every day.
-- number of days until purge.
set modDate to (60)
-- Only do for the current user.
tell application "System Events"
set currentUser to (name of current user)
end tell
-- Delete
tell application "Finder"
@ncremins
ncremins / .gitignore
Created September 25, 2013 11:18 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
@ncremins
ncremins / .gitconfig
Created October 2, 2012 10:07
Use external diff for git diff
[diff]
external = /home/neil/codemisc/diff.py
@ncremins
ncremins / gist:3812686
Created October 1, 2012 16:00
[MySQL] comma separated column names
SELECT GROUP_CONCAT(column_name ORDER BY ordinal_position)
FROM information_schema.columns
WHERE table_schema = 'DATABASE_HERE' AND table_name = 'TABLE_HERE'