Skip to content

Instantly share code, notes, and snippets.

View ChewingPencils's full-sized avatar

Sean Korzdorfer ChewingPencils

View GitHub Profile
@jbarratt
jbarratt / nblist
Last active August 29, 2015 14:04
nblist
#!/usr/bin/env python
""" A cross-platform (POSIX, at least) tool to list running IPython Notebooks
and their working directories.
This code will be incredibly simpler to write as of IPython 3.0, so
contains numerous workarounds to make it work on 2.x.
Thanks to @takluyver for the suggestions for improvement.
@erikrose
erikrose / wrap_comment.py
Last active September 23, 2015 14:27
Comment-wrapping filter for BBEdit 10
"""BBEdit UNIX filter that wraps one or more optionally-indented, commented
lines to 79 chars, preserving indentation.
Just select all the lines (in their entirety) the comment spans, and invoke.
Works with #, --, and //-style comments.
For example, this... ::
# Upping this to 10000 makes it 3x faster. 10000 takes 15.936s. 5000 takes 16.303s.
@benwaldie
benwaldie / 2013-01-20-TUAW_Waldie2.applescript
Created January 21, 2013 03:22
TUAW > TextExpander Date Snippets > Current Week
set theDate to (current date)
set theStartDate to theDate
repeat until weekday of theStartDate = Sunday
set theStartDate to theStartDate - 1 * days
end repeat
set theEndDate to theDate
repeat until weekday of theEndDate = Saturday
set theEndDate to theEndDate + 1 * days
end repeat
set theDate to (short date string of theStartDate) & " - " & (short date string of theEndDate)
@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
#!/usr/bin/python
# -*- coding:utf-8 -*-
import re
import csv
import sys
from datetime import datetime
tweets = csv.reader(open("tweets.csv"), delimiter=',', quotechar='"')
@hiilppp
hiilppp / redirect_to_pythonista.html
Created January 4, 2014 14:23
HTML file that opens Pythonista, where a specified script is executed, while the browser window closes in the background. This serves as workaround for IFTTT's lack of support for custom URL schemes in the URL parameter of Pushover's Channel.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; pythonista://foo.py&action=run&argv=bar"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script language="JavaScript">
setTimeout("self.close()", 500);
</script>
</head>
@collindonnell
collindonnell / Share With Dropbox.scpt
Created April 1, 2012 21:44
Copy's one or multiple items to the Dropbox public folder and copy's the URL's to the clipboard as a comma separated list.
(* Copyright (C) 2012 Collin Donnell
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE US
@cormacrelf
cormacrelf / things_parsedate.py
Last active July 25, 2016 00:40
Parse a natural language date and use that as the due date for a new Things task. Depends on https://gist.github.com/4583376
# Date parsing for Things
# by Cormac Relf - cormacrelf.com - @cormacrelf
# depends on parsedatetime
# use the .py files extracted from v0.8.7 from here: https://gist.github.com/4583376
# alternatively:
# download pipista; https://gist.github.com/4116558
# in the plain Pythonista console, type `import pipista`, then `pipista.pypi_download("parsedatetime")`
# download shellista; https://gist.github.com/4139094
# running shellista, enter the following commands, which have been shortened for your convenience:
@jessegrosjean
jessegrosjean / Example Document.ft
Created November 14, 2012 21:41
FoldingText – Autofocus System
# Autofocus.todo
- item 1
- item 3
# Autofocus.todo
- item 2
@naupaka
naupaka / DNS_tips.md
Last active August 4, 2018 10:45
Tips for dealing with DNS issues in OS X Yosemite