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
git clone ssh://company-repo | |
git remote add github git://github.com/awesomelibrary | |
git pull github | |
git push origin |
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
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct |
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 json | |
import pkgutil | |
import tweetpony | |
import modules | |
class DispatchingHandler(tweetpony.api.StreamProcessor): | |
def __init__(self, api): | |
tweetpony.api.StreamProcessor.__init__(self, api) | |
self.handlers = map(lambda h: h.inject_api(self.api), modules.active) |
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 raxa import on_tweet, on_mention | |
@on_mention(num_mentionees = 1,sender='shadowb0lt') | |
def on_ponies(tweet): | |
tweet.reply('Got a tweet from shadowb0lt with some mentionees ;-)!') |
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
funcs = [] | |
USER_STREAM = '__userstream__' | |
class on_tweet(object): | |
def __init__(self, sender = None): | |
print 'In on_tweet ctor with sender =' + sender | |
self.sender = sender |
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 json | |
import tweetpony | |
import glob | |
import raxa | |
import inspect | |
import os.path | |
# Now it gets ugly: | |
import modules # Parent | |
import imp # Please don't beat me up. |
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 raxa import config, every, api, on_mention | |
import re | |
import random | |
@config() | |
def config(c): | |
print 'Received config object: %s' % str(c) | |
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
def powersplit(s, seperators): | |
if not seperators: | |
return s | |
result = s.split(seperators[0]) | |
temp = [] | |
for sep in seperators[1:]: | |
for substring in result: | |
for subsplit in substring.split(sep): | |
stripped = subsplit.strip() |
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
# chemicalFormulas.py | |
# | |
# Copyright (c) 2003, 2007, Paul McGuire | |
# | |
from pyparsing import Word, Optional, OneOrMore, Group, ParseException | |
# define a simple Python dict of atomic weights, with chemical symbols | |
# for keys | |
atomicWeight = { |
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 base64 | |
import urllib | |
import hashlib | |
import hmac | |
def sign_url(url, key='test'): | |
h = hmac.new(bytes(key), url, digestmod=hashlib.sha1) | |
hmacs = urllib.quote_plus(base64.b64encode(h.digest())) | |
return url + '&hmac=' + hmacs | |
OlderNewer