Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# ReadingListCatcher
# - A script for exporting Safari Reading List items to Markdown and Pinboard
# Brett Terpstra 2015
# Uses code from <https://gist.github.com/robmathers/5995026>
# Requires Python pinboard lib for Pinboard.in import:
# `easy_install pinboard` or `pip install pinboard`
import plistlib
from shutil import copy
import subprocess
@tzarskyz
tzarskyz / gist:07ccdb64b7f860bd1f4c
Created June 6, 2014 11:41
Export Safari's Tab to frontmost FoldingText 2.x window - Alfred ready.
-- All code grabbed and requested help with from generous parties and unsuspecting github users.
--
-- Create Markdown link from front most tab in safari and append
-- to end of current FoldingText document as new list item.
-- UNCOMMENT FOR USE IN ALFRED
on alfred_script(q)
--on run
-- -- -- -- -- -- -- -- --
--
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
#!/usr/bin/env ruby
#
# Locates and removes Homebrew installation
# http://brew.sh/
#
# Author: Stephen Benner
# https://github.com/SteveBenner
#
require 'optparse'
require 'fileutils'
#!/bin/bash
echo '#!/bin/bash'
echo ''
echo 'failed_items=""'
echo 'function install_package() {'
echo 'echo EXECUTING: brew install $1 $2'
echo 'brew install $1 $2'
echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.'
echo '}'
#!/bin/bash
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864`
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152`
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK
CACHEDIR="/Volumes/RamDiskCache/$USER"
#!/bin/bash
tmsupportpath="/Library/Application Support/TextMate"
bundlepath="$tmsupportpath/Bundles"
if [ ! -d "$bundlepath" ]
then
echo "First time, eh? Making $bundlepath..."
mkdir -p "$bundlepath"
fi
if [ ! -d "$tmsupportpath/Support" ]
#
# This script will install the following Textmate bundles
#
# Languages
# - c https://github.com/textmate/c.tmbundle
# - coffeescript https://github.com/jashkenas/coffee-script-tmbundle
# - context free https://github.com/textmate/context-free.tmbundle
# - erlang https://github.com/textmate/erlang.tmbundle
# - haskell https://github.com/textmate/haskell.tmbundle.git
# - html https://github.com/textmate/html.tmbundle
// ==UserScript==
// @name Benchmark: getValue/setValue
// @namespace test
// @include http*
// @version 1
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
var iters = 40;
on alfred_script(q)
set {the_path, file_name} to parse_path(first item of q)
tell application "iTerm"
set _terminal to make new terminal
tell _terminal
launch session "Vim"
tell the last session
write text "cd \"" & the_path & "\""
# Replace e with your vim command