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 | |
import random | |
zen = """Beautiful is better than ugly. | |
Explicit is better than implicit. | |
Simple is better than complex. | |
Complex is better than complicated. | |
Flat is better than nested. | |
Sparse is better than dense. |
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
[bits 16] ; Tell assembler to use 16 bit code. | |
[org 7c00h] ; BIOS will load us to this address. | |
;=================================================================== | |
mov si, string_hello ; store string pointer into SI | |
call print_string | |
call sleep | |
;=================================================================== | |
print_string: |
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 re | |
import requests | |
def _clean_degrees(value): | |
return re.sub('[^-\.0-9]', '', value) | |
def get_coordinates(address): | |
"""Expects a string of address and returns tuple | |
(latitude, longitude) |
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
"""Traffline ETA | |
Usage: | |
traffline.py <source> <destination> <city> | |
""" | |
from docopt import docopt | |
import requests | |
import json |
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 -*- | |
from time import sleep | |
import lyricwiki | |
import appscript | |
it = appscript.app('iTunes') | |
def fetch_and_add_lyrics(): |
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 -*- | |
def devanagari_math(statement): | |
trans = { | |
u'१':'1', | |
u'२':'2', | |
u'३':'3', | |
u'४':'4', | |
u'५':'5', |
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 with much inspiration from: | |
-- https://gist.github.com/dylanwh/408810 | |
-- http://gaillourdet.net/2011/05/server-side-imap-filtering-done-right/ | |
-- Todo: include this: https://chris-lamb.co.uk/posts/rotating-email-your-inbox-using-imapfilter | |
options.timeout = 120 | |
options.subscribe = true | |
options.expunge = true | |
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 | |
import os, re | |
from subprocess import call, Popen, PIPE | |
def run(command): | |
print 'Running:', command | |
p = Popen(command, shell=True, stdout=PIPE) | |
lines = p.stdout.readlines() | |
for line in lines: |
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
""" | |
Script to create an .ideavimrc comptabile VIM lockdown key-remapper as used by github.com/hiway/po | |
This will unmap EVERYTHING and render your VIM useless - the idea is to begin with your own keymapping instead of VIM's legacy keymaps. You may refer to github.com/hiway/po for more information. | |
To create a new .lockdown_ideavim: `python ideavimlockdown.py > ~/.lockdown_ideavim` | |
Then use it within your ~/.ideavimrc by adding "source ~/.lockdown_ideavim" within the file. | |
""" | |
excludes = [":", "\n", "!", chr(0x9), chr(0x16), " ", '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '(', ')', ','] |
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 | |
"""Fetch top X URLs for keywords from Google.""" | |
import click # [sudo] pip install click | |
import requests # [sudo] pip install requests | |
search_url = u'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=%s' | |