Skip to content

Instantly share code, notes, and snippets.

-- toggle live search in BBEDIT
tell application "BBEdit"
tell window 1
set live search bar visible to (not live search bar visible)
end tell
end tell
import unittest
import re
THE_PATTERN= r'(^\s*(?P<function>(?P<function_name>[a-zA-Z0-9_@\.]+)\W*(=|:)\W*(\([a-zA-Z0-9_@,= \.@"{}\[\]]+\))?\W*(\-\>|\=\>)\W*))'
test_re = re.compile(THE_PATTERN)
class TestCoffeescriptFunctionParsing(unittest.TestCase):
def test_parse_simple_method(self):
@rwilcox
rwilcox / greasemoney_campfire_shaddup_robot.js
Last active December 23, 2015 21:09
A greasemonkey script to gray out Campfire messages from your Campfire Bot
// ==UserScript==
// @name Campfire Shaddup Robot
// @namespace http://fanzter.com/
// @downloadURL https://gist.github.com/rwilcox/6693982/raw/greasemoney_campfire_shaddup_robot.js
// @description Grays out Campfire talk by (defined) robots
// @include https://*.campfirenow.com/room/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant GM_log
// @version 1
@rwilcox
rwilcox / view_all_comments_for_pr.sh
Last active August 20, 2019 15:20
View all comments, even outdated ones, for a PR on Github
#!/opt/local/bin/zsh
# NOTE: requires ZSH for vered. If you're using another shell you'll need to set PULL_NUMBER, ORGANIZATION and REPO
# somehow yourself
# also depends on the jgrep gem (jgrep for "json grep"). jgrep respects object structure and lets
# me search for _links.html.href
GITHUB_USERNAME=rwilcox
GITHUB_PASSWORD=hahahahaha
@rwilcox
rwilcox / tmp_clone_and_open_in.sh
Last active September 13, 2016 20:31
Clone and open a Github project in BBEdit
#!/usr/bin/env zsh
# Think of this script like a remote version of npm edit
# Release in the public domain, by Ryan Wilcox 2013
cd /tmp
git clone $1
repo_name_incl_git=$(basename $1)
just_folder_name="${repo_name_incl_git%.*}"
bbedit $just_folder_name
@rwilcox
rwilcox / github_remove_relative_date_greasemonkey.user.js
Last active June 12, 2024 18:25
Remove Github's relative date
// ==UserScript==
// @name Github remove relative date stupidness
// @namespace http://www.wilcoxd.com
// @include https://github.com*
// @version 1
// @grant none
// ==/UserScript==
// created: WD-rpw 03-25-2013
@rwilcox
rwilcox / select_value_in_bbedit.applescript
Created February 11, 2013 16:02
In BBEdit, Selects the VALUE out of a Javascript record literal in Applescript
(*
This BBEdit script selects the VALUE out of a Javascript(style) KEY: value record literal
Imagine a BBEdit selection of this line:
{"editor":"bbedit", "os": "macosx"}
Running this script will select "bbedit" (with quotes).
@rwilcox
rwilcox / bbedit_selection_to_notational_velocity.applescript
Created February 5, 2013 14:54
BBEdit Selection to Notational Velocity (and delete)
on getNotesFolder() tell application "Finder" set homeFolder to path to home folder return folder "Notational Data" of folder "Application Support" of folder "Dropbox" of homeFolder end tell end getNotesFolder on run tell application "BBEdit" set sel to selection as string set the selection to "" tell me to set notesF to getNotesFolder() as alias activate set dialogRes to display dialog "Name the file:" default answer "something.markdown" set filePath to ((notesF as string) & (text returned of dialogRes)) set newDoc to (make new text document) set contents of newDoc to sel save newDoc to file filePath without saving as stationery end tell end run
@rwilcox
rwilcox / bbedit_text_filter_in_applescript.applescript
Last active September 13, 2016 20:31
bbedit_text_filter_in_applescript
-- this script transforms all your spaces into newlines
on RunFromBBEdit(rangeFromBBEdit)
-- RunFromBBEdit is called from BBEdit when you select this script from
-- the Text Filters submenu
--
-- I like putting the logic in this handler, which lets me easily test
-- my script in AppleScript Editor before using it in a text filer
-- like so
(*
@rwilcox
rwilcox / notify_me_when_in_jaconda_chat.markdown
Created October 25, 2012 19:05
Notify Me when my name is said in a Jaconda based Adium chat

There's a Adium plugin, pipeevent (Github), that lets you send stuff to Unix commands.

Adium XTras page for this says the plugin has been banned, so don't try. Just download it from the Files section of the Github page above

Original blog entry announcing this

People report issues with Adium crashing on message receive, but I don't have this issue (Adium 1.5.3)

Note: this works just fine with the Mute settings described above!!!