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
from sqlalchemy.sql.expression import Insert | |
from sqlalchemy.ext.compiler import compiles | |
class Upsert(Insert): | |
'''Compiles an upsert expression for use with mysql. | |
Requires a keyword arg ``upsert_fields`` which lists field names to be updated in | |
the ON DUPLICATE KEY UPDATE clause. | |
''' |
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/env python | |
import smtplib | |
class GMail(object): | |
hostname = 'smtp.gmail.com' | |
port = 587 | |
def __init__(self, username=None, password=None): | |
self.server = smtplib.SMTP(self.hostname, self.port) | |
self.server.ehlo() |
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/env python | |
""" | |
RTM Task emailer | |
Emails all current incomplete RTM tasks. It uses a gmail account to | |
send the email. | |
SETUP: | |
Edit RTM_USERNAME, USERNAME, PASSWORD below | |
The first time you run the script, run it with the "auth" argument |
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/env python | |
# Copyright (C) 2011 by Jonathan Beluch | |
# | |
# 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: | |
# |
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/env python | |
''' | |
Jonathan Beluch - web@jonathanbeluch.com | |
Scrapes movie titles from http://www.classiccinemaonline.com and | |
creates a histogram showing the distribution of titles by year. | |
Requires BeautifulSoup, matplotlib and numpy. | |
''' |
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
import xbmc, xbmcgui | |
url = 'rtmp://69.31.76.55:1935/ondemand/flvstream?_fcs_vhost=cp94207.edgefcs.net&akmfv=1.7/webtv_afrique/3125822' | |
playpath = 'webtv_afrique/3125822' | |
li = xbmcgui.ListItem(path=url) | |
li.setProperty('PlayPath', playpath) | |
li.setProperty('TcUrl', url) | |
xbmc.Player(xbmc.PLAYER_CORE_AUTO).play(url, li) |
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
#!/bin/sh | |
# Stream AlJazeera Live (English) - http://english.aljazeera.net/watch_now/ | |
rtmpdump -v -r rtmp://livestfslivefs.fplive.net/livestfslive-live/ -y "aljazeera_en_veryhigh?videoId=747084146001&lineUpId=&pubId=665003303001&playerId=751182905001&affiliateId=" -W "http://admin.brightcove.com/viewer/us1.24.04.08.2011-01-14072625/federatedVideoUI/BrightcovePlayer.swf -p "http://english.aljazeera.net/watch_now/ -a "aljazeeraflashlive-live?videoId=747084146001&lineUpId=&pubId=665003303001&playerId=751182905001&affiliateId=" | mplayer - |
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/env python | |
'''A simple script for finding facebook profile ids for a given list of email | |
addresses. | |
Requires eventlet to be installed. | |
$ pip install eventlet | |
Also, currently requires a list of contacts exported from Google contacts. | |
Choose the outlook format and name the file 'contacts.csv' in this dir.''' |
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
import XMonad | |
import XMonad.Hooks.FadeInactive | |
import XMonad.Config.Gnome | |
import XMonad.Hooks.ManageDocks | |
import qualified Data.Map as M | |
import XMonad.Util.EZConfig(additionalKeys) | |
import qualified XMonad.StackSet as W | |
import XMonad.Hooks.ManageHelpers | |
import XMonad.Layout.NoBorders |
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/env python | |
from xbmcswift import Plugin, download_page | |
from BeautifulSoup import BeautifulSoup as BS, SoupStrainer as SS | |
from urlparse import urljoin | |
import re | |
__plugin_name__ = 'Academic Earth' | |
__plugin_id__ = 'plugin.video.academicearth' | |
plugin = Plugin(__plugin_name__, __plugin_id__) |
OlderNewer