Skip to content

Instantly share code, notes, and snippets.

@kueda
kueda / tmbundle.sh
Created October 14, 2008 16:49
Simple bash script for installing TextMate bundles
#!/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" ]
property dueTag : "due"
property startTag : "start"
property repeatTag : "repeat"
property todayTag : "today"
property pastDueTag : "overdue"
property upcomingTag : "upcoming"
property doneTag : "done"
property inProgressTag : "inprogress"
property errorTag : "error"
property removeTags : {upcomingTag, todayTag, pastDueTag, inProgressTag}
javascript:
if (window.hah){
hah.removeHints();
}
window.hah = {
hintKeys : new String('asdfghjkl'),
selector: 'a[href]:not([href^="mailto:"]), input:not([type="hidden"]), textarea, select, img[onclick], button',
xpath: '//a[@href]|//input[not(@type=\x22hidden\x22)]|//textarea|//select|//img[@onclick]|//button',
xpathMode : true,
hintColorLink : '\x23FFFF00',
@seandenigris
seandenigris / Info.plist
Created March 3, 2010 02:48
Quicklook for HAML and ERB files (see instructions at http://seandenigris.com/?p=403)
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
<string>public.source-code</string>
</array>
<key>UTTypeDescription</key>
<string>Ruby HTML Template file</string>
@seandenigris
seandenigris / gist:322074
Created March 4, 2010 20:28
Syntax highlight files in Quicklook
# Snippet to syntax-highlight source code files matching a certain pattern in Quicklook
# See see http://seandenigris.com/?p=412 for more info for more info
# Used with the qlcolorcode plugin
# Insert into QLColorCode.qlgenerator/Contents/Resources/colorize.sh
# Works for files in languages known to highlight (see qlcolorcode docs), but because of their filename, aren't recognized by Quicklook
#The commented lines are already in the file
#
# debug Handling special cases
@mkdynamic
mkdynamic / bundles.sh
Created June 18, 2010 02:31
Install all of http://github.com/phuibonhoa's TM bundles (OS X only)
#!/usr/bin/env bash
#
# install all of http://github.com/phuibonhoa's TM bundles (OS X only)
#
echo "Installing bundles..."
# backup dir
if [ -d ~/desktop/_tm_bundle_backups ]; then rm -rf ~/desktop/_tm_bundle_backups; fi
@iloveitaly
iloveitaly / vpn-utilities.applescript
Created July 3, 2010 19:05
Configure / create VPN connections via applescript
-- Author: Michael Bianco <http://mabblog.com/>
-- Some help from: http://discussions.info.apple.com/message.jspa?messageID=10363317
on create_vpn_service(vpn_name)
tell application "System Preferences"
reveal pane "Network"
activate
tell application "System Events"
tell process "System Preferences"
require 'growl'
module Jekyll
class GrowlPreHook < Hook
safe false
sequence :pre
def run(site)
Growl.notify 'Building...', :title => 'Jekyll'
end
on run {input, parameters}
repeat with n in input
set z to (n as alias)
set n to (info for z)'s name
tell application "Finder" to set P to z's container as alias
set zP to POSIX path of (P as text) & n
try
set the_URL to do shell script "mdls -name kMDItemWhereFroms" & space & zP & space & "|" & space & "grep -o '\"'.*'\"'"
set the_URL to replace_chars(the_URL, "\"", "")
tell application "Finder"
@gruber
gruber / gist:647224
Created October 26, 2010 16:26 — forked from dpk/gist:646570
Slight tweaks to dpkendal's script. Gives the BBEdit document a name (rather than "untitled <integer>", and skips the \n to \r stuff, which I don't think is necessary in recent versions of BBEdit.
tell application "Safari"
set _source to do JavaScript "window.document.documentElement.outerHTML" in document 1
set _name to name of document 1
end tell
tell application "BBEdit"
make new text window with properties ¬
{contents:_source, source language:"HTML", name:"Generated source: " & _name}
select insertion point before character 1 of text window 1