Skip to content

Instantly share code, notes, and snippets.

View brettkelly's full-sized avatar

Brett Kelly brettkelly

View GitHub Profile
#!/usr/bin/env python
import re, sys
input = '%clipboard'
r = re.compile("!\[\]\(images\/([^.]+).png\)")
m = r.match(input)
if m:
outp = "<$img:%s>" % m.groups()[0]
else:
@brettkelly
brettkelly / post.md
Last active December 20, 2015 17:09

I'm a blog post

I have Markdown syntax like bold

Can you diff me?

I have a new line of text with an image...

@brettkelly
brettkelly / NewMeeting.applescript
Created July 18, 2013 19:41
Super simple AS to create a new stub meeting note in Evernote.
set myNotebook to "@Inbox"
set myTags to {"to_process"}
set myTitle to "Meeting Notes with "
set myContent to ""
tell application "Evernote"
set myNote to create note title myTitle with text myContent notebook myNotebook tags myTags
delay (1) -- give the note a sec to save
open note window with myNote
end tell
@brettkelly
brettkelly / gist:5891795
Created June 29, 2013 16:42
A crude regex for muting all #___chat hashtags using Tweetbot.
#[^ ]+chat
@brettkelly
brettkelly / foo.applescript
Created May 23, 2013 20:39
Grab the source URL from the current note and open it in the default browser.
tell application "Evernote"
set myNote to selection
try
set myUrl to (source URL of item 1 of myNote)
tell application "System Events"
open location myUrl
end tell
on error
-- real programmers would put something here
end try
@brettkelly
brettkelly / nvAltNoteFromSelection.applescript
Created April 18, 2013 18:02
AppleScript to create a new nvAlt note from the selected text in any app.
-- copy selected text
tell application "System Events"
keystroke "c" using command down
end tell
-- switch to nvAlt
tell application "nvALT"
activate
tell application "System Events"
keystroke "l" using command down -- Create or Search
#!/usr/bin/env python
# Copyright 2013 Evernote Corporation
# Move gists to evernotegists
import base64
import json
import os.path
import re
// I'm a java file
# I'm a ruby file
# I'm a python file