This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Add a button to Finder that opens iTerm to the current directory | |
-- Inspired by http://peterdowns.com/posts/open-iterm-finder-service.html | |
-- but updated to use the new iTerm nightly build AppleScript API and OSX 10.9.5 AppleScript | |
-- Setup (same as above link): | |
-- - Create a new Automator Application | |
-- - Add a "Run AppleScript" action | |
-- - Paste this in and save | |
-- - with Command-drag the application to the top bar in Finder | |
on run {input, parameters} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The nightly builds of iTerm have changed its AppleScript API, which breaks Alfred's default iTerm integration. | |
-- The new API examples are here: https://iterm2.com/applescript.html | |
-- Discussion about it and support can be found here: https://groups.google.com/forum/#!msg/iterm2-discuss/PcMGixwuceY/81JMZheXb_UJ | |
--Simply paste this into the box under Alfred Preferences > Terminal/Shell > Application: Custom | |
on alfred_script(q) | |
tell application "iTerm" | |
create window with default profile | |
tell current session of last terminal window | |
write text q & "; clear" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Board(list): | |
'''Interprets board[1,2] as board[1][2]''' | |
def __getitem__(self, key): | |
try: | |
cur = self | |
key = list(key) | |
while len(key) > 0: | |
cur = list.__getitem__(cur, key.pop(0)) | |
return cur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Parses end executes mathematical expressions with functions mixed in. | |
* TODO: add referencing symbols elsewhere on the page (via some selector). | |
**/ | |
%{ | |
var funcs = { | |
pow: function(a,b) { return Math.pow(a,b); }, | |
test: function(a) { return a*2; } | |
} | |
%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''My solution to the ITA puzzle "Word Numbers" | |
<http://www.itasoftware.com/careers/puzzle_archive.html> | |
"If the integers from 1 to 999,999,999 are written as words, | |
sorted alphabetically, and concatenated, what is the 51 billionth letter?" | |
To be precise: if the integers from 1 to 999,999,999 are expressed in words | |
(omitting spaces, 'and', and punctuation[1]), and sorted alphabetically | |
so that the first six integers are | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#Converts arisia HTML schedule to the following format: | |
#{name:NAME, start:YYYY-MM-DDTHH:MM:SS.000-05:00, end:(same as start), location:LOCATION, body:TEXT} | |
#name includes type | |
import re | |
from datetime import datetime, timedelta | |
import dateutil.parser | |
from sample import main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reset | |
NoColor='\[\e[m\]' # Text Reset | |
# Regular Colors | |
Black='\[\e[0;30m\]' # Black | |
Red='\[\e[0;31m\]' # Red | |
Green='\[\e[0;32m\]' # Green | |
Yellow='\[\e[0;33m\]' # Yellow | |
Blue='\[\e[0;34m\]' # Blue | |
Purple='\[\e[0;35m\]' # Purple |
NewerOlder