Skip to content

Instantly share code, notes, and snippets.

View waynew's full-sized avatar
💭
Making the world a little Saltier - one grain at a time

Wayne Werner waynew

💭
Making the world a little Saltier - one grain at a time
View GitHub Profile
import sys
import logging
import tweepy
logger = logging.getLogger()
logger.addHandler(logging.FileHandler('test.log'))
logger.setLevel(logging.DEBUG)
auth = tweepy.OAuthHandler(
'API Key',
from __future__ import print_function
import json
import logging
import sys
import tweepy
from datetime import datetime, timedelta
list_one = [1,1,1]
list_two = [2,2,2]
list_three = [3,3,3]
t_list = [list_one, list_two, list_one, list_one, list_three]
one_list = [list_one, list_one, list_one]
>>> class Foo(object):
... def bar(self):
... print('Foo-y bar')
...
>>> class Bar(Foo):
... def __init__(self):
... super(Bar, self).bar()
... super(Foo, self).bar()
... def bar(self):
... print('Bar bar jinks')
from flask import Flask, redirect, url_for, render_template
app = Flask(__name__)
def get_light_states():
return 'blue', 'no yellowwwww!'
@app.route('/')
import os
import tempfile
with tempfile.NamedTemporaryFile() as f:
filename = f.name
# Technically that already opens a file, but I want to be explicit about
# open
handle_one = open(filename, 'w+')
from __future__ import print_function
import json
import logging
import os
import sys
import tweepy
from datetime import datetime, timedelta
BEGIN:VCALENDAR
METHOD:CANCEL
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Eastern Standard Time
BEGIN:STANDARD
DTSTART:16010101T020000
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'k' is not defined
@waynew
waynew / does_it_pdb.py
Created July 13, 2016 18:02
Yes, pdb *does* work
import matplotlib.pyplot as plt
def fnord():
data = [1,2,3]
import pdb; pdb.set_trace()
plt.plot(data)
plt.show()