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
| # Steps to build and install tmux from source on Ubuntu. | |
| # Takes < 25 seconds on EC2 env [even on a low-end config instance]. | |
| VERSION=2.5 | |
| sudo apt-get -y remove tmux | |
| sudo apt-get -y install wget tar libevent-dev libncurses-dev | |
| wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz | |
| tar xf tmux-${VERSION}.tar.gz | |
| rm -f tmux-${VERSION}.tar.gz | |
| cd tmux-${VERSION} | |
| ./configure |
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
| # This plays asciicast (v1 format - https://github.com/asciinema/asciinema/blob/master/doc/asciicast-v1.md) in your terminal: | |
| # ruby play.rb asciicast.json | |
| require 'json' | |
| JSON.parse(File.read(ARGV[0]))['stdout'].each do |frame| | |
| sleep frame[0] | |
| STDOUT.write frame[1] | |
| STDOUT.flush | |
| end |
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
| # Created by Kendall Buchanan (https://github.com/kendagriff) on 2011-12-22. | |
| # Use at your own risk. The end. | |
| # | |
| # Usage: | |
| # (URL) | |
| # ruby -r 'jekyll/jekyll-import/rss' -e "JekyllImport::RSS.process(:source => 'http://yourdomain.com/your-favorite-feed.xml')" | |
| # | |
| # (Local file) | |
| # ruby -r 'jekyll/jekyll-import/rss' -e "JekyllImport::RSS.process(:source => './somefile/on/your/computer.xml')" |
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
| from functools import wraps | |
| def skip_when_testing(func=None): | |
| """ | |
| Provides a way to provide functionality that only applies in the real production environment, otherwise stubs out the function. | |
| Use this with **care** as this makes testability difficult and can lead to errors/bugs leaking into production. This should really only be used for non-functional (fire-and-forget) components like error logging or analytics. | |
| """ | |
| def wrapper(func): |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| Flask-Login example | |
| =================== | |
| This is a small application that provides a trivial demonstration of | |
| Flask-Login, including remember me functionality. | |
| :copyright: (C) 2011 by Matthew Frazier. | |
| :license: MIT/X11, see LICENSE for more details. | |
| """ |
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 sys | |
| import urllib | |
| import json | |
| from pyechonest import playlist | |
| def show_playlist(seed_artist): | |
| for s in playlist.basic(artist=seed_artist, type='artist-radio', ] | |
| buckets=['id:lyricfind-US'], results=10, limit=True): | |
| print '==================================================================' |
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
| var page = new WebPage(), | |
| address, output, size; | |
| //capture and captureSelector functions adapted from CasperJS - https://github.com/n1k0/casperjs | |
| capture = function(targetFile, clipRect) { | |
| var previousClipRect; | |
| var clipRect = {top: 0, left:0, width: 40, height: 40}; | |
| if (clipRect) { | |
| if (!isType(clipRect, "object")) { | |
| throw new Error("clipRect must be an Object instance."); |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| You need to fill in your API key from google below. Note that querying | |
| supported languages is not implemented. | |
| Language Code | |
| -------- ---- | |
| Afrikaans af | |
| Albanian sq | |
| Arabic ar |
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 python | |
| # coding: utf-8 | |
| # You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
| # Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
| # any TTF you have) | |
| # Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
| # License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
| from image_utils import ImageText |
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
| ''' | |
| This python script listens for distributed notifications from iTunes of new songs playing, | |
| works alot better then constantly polling. | |
| ''' | |
| import Foundation | |
| from AppKit import * | |
| from PyObjCTools import AppHelper | |
| class GetSongs(NSObject): | |
| def getMySongs_(self, song): |
NewerOlder