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
$('time').each(function(i, time) { var $time = $(time); $time.removeClass('js-relative-date'); $time.text($time.attr('title')); }) |
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 datetime | |
# requires python-dateutil (http://labix.org/python-dateutil) | |
from dateutil.relativedelta import relativedelta | |
def get_month_day_range(date): | |
""" | |
For a date 'date' returns the start and end date for the month of 'date'. | |
Month with 31 days: |
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 transpose(matrix): | |
num_rows = len(matrix) | |
num_cols = len(matrix[0]) | |
t_matrix = [[None for _ in range(num_rows)] for _ in range(num_cols)] | |
for y in range(num_rows): | |
for x in range(num_cols): | |
t_matrix[x][y] = matrix[y][x] | |
return t_matrix |
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 tweepy | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token_key, access_token_secret) | |
api = tweepy.API(auth) | |
user = api.get_user('twitter') | |
print user.status.text |