Skip to content

Instantly share code, notes, and snippets.

@rwilcox
rwilcox / to_worksheet.applescript
Created November 15, 2011 02:55
Save current open BBEdit documents to Unix Worksheet for later
tell application "BBEdit"
set output to ""
set docs to every project document
repeat with current in docs
repeat 1 times
if file of current is missing value then
exit repeat
end if
set asAlias to file of current as alias
@rwilcox
rwilcox / email.plist
Created November 23, 2011 05:37
Super Simple Email Codeless Language Module for BBEdit
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!--
BBEdit codeless language module for email (for example, what comes out of Mutt when you use "bbedit -w" as its editor)
Feel free to customize.
By Ryan Wilcox
Requires BBEdit 8.0 or higher. To install, copy here:
@rwilcox
rwilcox / fabfile.py
Created December 22, 2011 01:36
Calling Django models from Fabric
# ##############################################################################
# NOTE: this fab file requires at least Fabric 1.3.3
# ##############################################################################
# ##############################################################################
# ######## Do tricky things to sys.path so that we can load the Django app into this script
# ##############################################################################
# This section of code assumes that when you are running the fab script that your
# current working directory is django_project/ .
#
@rwilcox
rwilcox / load_modules.py
Created December 22, 2011 01:43
Load Django models from Fabric
from fabric.api import run, local, hosts, cd
from fabric.contrib import django
django.project('django_project')
import django_project
from django_project.pages.models import Page, Section
@rwilcox
rwilcox / move_document_to_new_bbedit_window.applescript
Created January 26, 2012 15:18
Move Document to new BBEdit window
tell application "BBEdit"
set dest to make new text document
select dest
set oldLocation to text window 2
move document 1 of oldLocation to dest's window
set files visible of dest's window to false
-- bounds are Left, top, right, bottom
@rwilcox
rwilcox / gist:1902291
Created February 24, 2012 17:38
ProjectorPM Error
Uncaught TypeError: Cannot read property 'stories' of undefined http://www.projectorpm.com/assets/projector-4a04e7931a931122fe43138035f79142.js:11
http://www.projectorpm.com/_/projects/undefined/stories?socket_id=undefinedFailed to load resource: the server responded with a status of 404 (Not Found)
@rwilcox
rwilcox / open_here.applescript
Created March 9, 2012 14:26
Open Here in Current iTerm Tab
tell application "BBEdit" to set theFile to file of document 1
tell application "Finder" to set theFolder to (container of file theFile) as alias
set theUnixPath to POSIX path of theFolder
tell application "iTerm"
tell current session of current terminal
write text "pushd \"" & theUnixPath & "\""
end tell
activate
end tell
@rwilcox
rwilcox / open_here_in_shell_worksheet.applescript
Created March 13, 2012 12:42
BBEdit Script to Open Here In Shell Worksheet
tell application "BBEdit" to set theFile to file of document 1
tell application "Finder" to set theFolder to (container of file theFile) as alias
set theUnixPath to POSIX path of theFolder
set output to return & "cd '" & theUnixPath & "'; pwd"
tell application "BBEdit"
set uws to Unix worksheet window
tell uws
select insertion point after last character
set selection to output
@rwilcox
rwilcox / scratchpad_now.applescript
Created March 21, 2012 13:11
Open Scratchpad *NOW*
-- but this in your system level Script menu (using the Script Menu builtin in OS X, or Fastscripts from http://red-sweater.com
tell application "BBEdit"
set newDoc to scratchpad window
select newDoc
activate
end tell
@rwilcox
rwilcox / bbedit_markdown_list
Created March 31, 2012 22:30
BBEdit Markdown List Clipping
#INSERTION#:
#INSERTION#