Skip to content

Instantly share code, notes, and snippets.

function tabname {
# Will use current dir name if called without arg.
printf "\e]1;${1-$(basename `pwd`)}\a"
}
function winname {
# Will use current dir name if called without arg.
printf "\e]2;${1-$(basename `pwd`)}\a"
}
function tab {
# Will cd into current dir if called without arg.
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
(function () {
function callback() {
(function ($) {
var jQuery = $;
$("#loadingp").fadeOut("fast", function () {
$(this).remove();
});
var selectMarkdown = function () {
var doc = document,
text = doc.getElementById("fymdoutput"),
#!/bin/bash
target=$1
filename=`basename $1`
image="${TMPDIR}${filename}.png"
rsrc="${TMPDIR}icn.rsrc"
# Create a thumbnail from the file preview
qlmanage -t -s 512 -o ${TMPDIR} $target
# =============================================================
# = OpenMeta to OS X Tags =
# =============================================================
# Script to convert OpenMeta tags to OS X Mavericks tags.
#
# Created by Zettt (Andreas Zeitler) on 2013-06-28
# Source www.macosxscreencasts.com, mosx.tumblr.com
#
# OpenMeta to OS X Tags by Andreas Zeitler is licensed under a
# Creative Commons Attribution-NonCommercial-ShareAlike
#!/bin/bash
target=$1
filename=`basename $1`
image="${TMPDIR}${filename}.png"
rsrc="${TMPDIR}icn.rsrc"
# Create a thumbnail from the file preview
qlmanage -t -s 512 -o ${TMPDIR} $target
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>bundleUUID</key>
<string>A9237092-D694-450A-8C8F-F9005D932664</string>
<key>command</key>
<string>osascript -e 'tell application "Safari" to set theSource to do JavaScript "window.document.documentElement.outerHTML" in document 1'</string>
tell application "Safari"
tell front document
set theURL to URL
set theName to (do JavaScript "(getSelection())")
if length of theName is equal to 0 then set theName to name
end tell
end tell
tell application "TaskPaper"
tell front document
tell project named "Inbox"
set default_settings to "# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
bind right:alt resize +10% +0
bind left:alt resize -10% +0