Skip to content

Instantly share code, notes, and snippets.

@goblindegook
goblindegook / README.md
Created February 26, 2012 22:59 — forked from michaelfox/README.md
Notational Velocity (nvALT) Custom Stylesheet and Markup HTML

Usage

Copy these files to your ~/Library/Application Support/Notational Velocity/ folder.

@Watson1978
Watson1978 / macruby_uninstall
Created February 27, 2012 23:43
MacRuby : uninstaller
#!/bin/bash
# MacRuby
rm -rf /Library/Frameworks/MacRuby.framework
XCODE_DIR=`xcode-select -print-path`
# tool
rm -f "$XCODE_DIR"/usr/bin/rb_nibtool
rm -f "$XCODE_DIR"/Tools/rb_nibtool
@rooreynolds
rooreynolds / things_beta_list_completed_tasks.sh
Created March 9, 2012 23:39
Extracting useful data from Things (Cloud beta) via its SQLite database
#Completed tasks (showing their title, start date, completion date and time to complete in days)
sqlite3 -csv -header ~/Library/Application\ Support/Cultured\ Code/Things\ beta/ThingsLibrary.db "SELECT
substr(ZTITLE,0,26) as title,
datetime(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime') as startdate,
datetime(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime') as completeddate,
round(julianday(datetime(ZSTOPPEDDATE, 'unixepoch', '+31 years', 'localtime')) - julianday
(datetime(ZCREATIONDATE, 'unixepoch', '+31 years', 'localtime')),5) as age
FROM ZTHING WHERE ZSTATUS = 3 ORDER BY completeddate;
@brendangregg
brendangregg / gist:2014938
Created March 11, 2012 03:58
DTrace Mac OS X launchd write origin
root@macbook:~> dtrace -n 'io:::start /!(args[0]->b_flags & B_READ) && execname == "launchd"/ { trace(execname); stack(); }'
dtrace: description 'io:::start ' matched 1 probe
CPU ID FUNCTION:NAME
0 19368 buf_strategy:start launchd
mach_kernel`buf_strategy+0x5e
mach_kernel`hfs_vnop_strategy+0x34
mach_kernel`VNOP_STRATEGY+0x2f
mach_kernel`buf_bwrite+0x257
mach_kernel`hfs_vnop_bwrite+0x12a
mach_kernel`VNOP_BWRITE+0x2f
@bradt
bradt / setup-dnsmasq-os-x-lion
Created March 11, 2012 20:23
Setting up dnsmasq for Local Web Development Testing on any Device
# Setting up dnsmasq for Local Web Development Testing on any Device
Please note, these instructions are for OS X Lion.
First, you need to get the IP address of your machine on your local network. In OS X, the easiest place to find this is in System Preferences > Network. If you're using DHCP on your local network, you will want to make sure your computer requests the same IP address when it renews it's IP address lease. I recommend configuring the DCHP Reservation settings on your router to accomplish this. Otherwise, you can specify a manual address in your network settings:
1. Go to *System Preferences > Network*
1. Click *Advanced...*
@jshell
jshell / gist:2047480
Created March 15, 2012 22:54
Underline Titles (Markdown, reStructuredText) in BBEdit
tell application "BBEdit"
set x to startLine of selection
tell text 1 of window 1
if x = 1 then return
set myline to line x
set title_line to line (x - 1)
set underline_char to contents of first character of myline
set underline_str to ""
repeat (length of title_line) times
set underline_str to underline_str & underline_char
# put this at ~/.gitconfig
[alias]
# I'm lazy, so two letters will always trump the full command
co = checkout
ci = commit
cp = cherry-pick
st = status
br = branch
@DAddYE
DAddYE / hack.sh
Created March 19, 2012 11:31
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions:
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@rwilcox
rwilcox / gist:2288375
Created April 3, 2012 00:49 — forked from jshell/gist:2047480
Underline Titles (Markdown, reStructuredText) in BBEdit
-- Thanks to hristopher Stone
tell application "BBEdit"
set textDocument1 to a reference to text of text document 1
tell textDocument1
tell line (startLine of selection)
if startLine > 1 then
set lineContent to contents
if (length of lineContent = 1) and (lineContent is not " ") then
set prevLineContent to contents of textDocument1's line ((startLine) - 1)
tell application "BBEdit" to replace "." using lineContent searchingString prevLineContent options {search mode:grep}