This file contains hidden or 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
| ffmpeg -i in.mov -s 640x360 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=6 > out.gif |
This file contains hidden or 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
| def tokenize(string): | |
| # Regular expression to extract blocks | |
| _recipient = re.compile(r'^(.+?)\s(in|to|about)\b', | |
| re.IGNORECASE) | |
| _time = re.compile(r'\bin\s(\d+\s\b.+?\b)(?:\sto\b|\sabout\b|$)', | |
| re.IGNORECASE) | |
| _message = re.compile(r'\b(?:to|about)\s(.+?)(?:\sin\b|$)', | |
| re.IGNORECASE) |
This file contains hidden or 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
| [ | |
| { "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} } | |
| ] |
This file contains hidden or 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
| /* global Application, ObjC, $ */ | |
| /** | |
| * repozish.js | |
| * | |
| * this is an example of using os x yosemite's "JavaScript for Automation": | |
| * | |
| * https://developer.apple.com/library/prerelease/mac/releasenotes/interapplicationcommunication/rn-javascriptforautomation/index.html | |
| * | |
| * it repositions some windows based on some position settings. you can run |
This file contains hidden or 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
| #!/bin/bash | |
| # Save script to ~/.irssi.sh | |
| # Creates a screen and starts irssi in it. | |
| # If the screen already exists, it simply attaches it. | |
| # Create an alias in your ~/.bashrc to access it simply. | |
| # alias irc='~/.irssi.sh' | |
| if screen -list | grep -q "irssi"; then | |
| screen -x irssi | |
| else |
This file contains hidden or 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
| import ui | |
| # Mapping based on http://www.upsidedowntext.com/unicode | |
| CHARMAP = {'!': '\xc2\xa1', '"': ',,', | |
| "'": ',', '&': '\xe2\x85\x8b', | |
| ')': '(', '(': ')', ',': "'", | |
| '.': '\xcb\x99', | |
| '1': '\xc6\x96', | |
| '0': '0', '3': '\xc6\x90', | |
| '2': '\xe1\x84\x85', |
This file contains hidden or 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
| curl -sIL `pbpaste` | grep ^[lL]ocation | cut -c 11- | pbcopy |
This file contains hidden or 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/env python2.7 | |
| import tempfile | |
| from reportlab.graphics import renderPDF | |
| from reportlab.pdfgen import canvas | |
| import qrcode | |
| import qrcode.image.svg | |
| from svglib.svglib import svg2rlg |
This file contains hidden or 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
| extension Dictionary /* <KeyType, ValueType> */ { | |
| func mapKeys<U> (transform: KeyType -> U) -> Array<U> { | |
| var results: Array<U> = [] | |
| for k in self.keys { | |
| results.append(transform(k)) | |
| } | |
| return results | |
| } |
This file contains hidden or 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
| # Grab a URL from Chrome, Safari, Mail, Contacts, Finder, TextEdit, Omnifocus, Chrome Canary, or FoldingText | |
| # Borrowed from: http://www.alfredforum.com/topic/917-reminders/?hl=reminders | |
| tell application (path to frontmost application as text) | |
| set theApplication to get name | |
| end tell | |
| set theText to "" | |
| set theBody to "" | |
| if theApplication is "Google Chrome" then | |
| tell application id "com.google.chrome" |