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 django.db import models | |
from django.utils import simplejson as json | |
from django.conf import settings | |
from datetime import datetime | |
import time | |
class JSONEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, datetime): | |
return obj.strftime('%Y-%m-%d %H:%M:%S') |
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 pynotify | |
from time import sleep | |
def mins_to_secs(ms): | |
return map(lambda x: x * 60, ms) | |
class Pymodoro(object): | |
POMODORO_TIME = 25 * 60 | |
POMODORO_CHECKPOINTS = mins_to_secs([25, 15, 10, 5, 3, 1]) + range(10) |
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
# -*- coding: utf-8 -*- | |
import os | |
from flask import Flask | |
from flask_heroku import Heroku | |
from flask_sslify import SSLify | |
from raven.contrib.flask import Sentry | |
from flask.ext.celery import Celery |
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
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString *CellIdentifier = @"Cell"; | |
CGSize newSize = CGSizeMake(70, 70); | |
Story *currentStory = [[storyParser stories] objectAtIndex:indexPath.row]; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (cell == nil) { |
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/local/bin/python | |
from optparse import OptionParser | |
import os | |
PATH_SEPARATOR = os.sep | |
html_page = "<!DOCTYPE html>\n" \ | |
" <html>\n" \ |
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
var currentWin = Ti.UI.currentWindow; | |
// below example would require variable declarations for Name, Description, image, Lat, Longitude | |
// Docs: | |
// http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.Annotation-object | |
// http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Map.MapView-object | |
// | |
// CREATE MAP VIEW | |
// |
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
/* | |
* Android API Guide | |
* http://developer.android.com/guide/topics/ui/actionbar.html | |
* Android Design Guide | |
* http://developer.android.com/design/patterns/actionbar.html | |
* Titanium Mobile will support someday | |
* https://jira.appcelerator.org/browse/TIMOB-2371 | |
*/ | |
var osName = Ti.Platform.osname, | |
isAndroid = osName==='android', |
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
<VirtualHost *> | |
ServerName example.com | |
WSGIDaemonProcess www user=max group=max threads=5 | |
WSGIScriptAlias / /home/max/Projekte/flask-upload/flask-upload.wsgi | |
<Directory /home/max/Projekte/flask-upload> | |
WSGIProcessGroup www | |
WSGIApplicationGroup %{GLOBAL} | |
Order deny,allow |
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 | |
# | |
# Converts any integer into a base [BASE] number. I have chosen 62 | |
# as it is meant to represent the integers using all the alphanumeric | |
# characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
# | |
# I plan on using this to shorten the representation of possibly long ids, | |
# a la url shortenters | |
# |
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
""" | |
Script to identify accounts followed older than 4 months. | |
Source blogpost: http://www.rainbowbreeze.it/identify-your-twitter-followings-older-that-4-months | |
""" | |
import tweetpony | |
from datetime import timedelta, datetime | |
import urllib3.contrib.pyopenssl | |
import time |
OlderNewer