There are some pretty useful sites out there, but some interfaces are just plain annoying. Take pof.com for example: they have millions of users, but haven’t touched their interface since the beginning; if you get lots of messages it becomes a pain to go through them all very quickly. I figured it might be easier […]
Category Archives: Uncategorized
Push notifications with Flask, EventSource and Redis
Save the file below as push_notifications.py Run python push_notifications.py Open a bunch of browsers pointing to http:localhost:5000/ Open up each browser’s console window. Hit submit in one, the rest should update. push_notifications.py: You need to have Flask and redis installed:
Post to Facebook on Behalf of Your User with Python/Django
Posting on facebook through python is fairly simple: you need acquire your user’s facebook access token, which you use to access the users facebook wall. Step 1: Create the facebook app First, create a new facebook app on https://developers.facebook.com/apps and note down the APP_ID and APP_SECRET. Store this information in your django settings.py file. Step […]
Crop your images with CSS!
Instead of tracking down your language’s fancy image libraries, you can crop images very quickly with css. Simply use negative absolute positioning! HTML: CSS: If you don’t know the size of the image beforehand, you can use some javascript to compute the height and width:
Setting up iOS Push Notifications (APNS) with Python/Django through pyapns
Working with iOS for the first time can be a bit frustrating. For me, the most frustrating part was working with developer.apple.com. Here I hope to help make push notifications with Python as painless as possible. Step 1: Enable for Apple Push Notification service and generate a certificate To get started, log in to you developer […]
How to Make a Bootable Linux USB on Mac OS X
I’ve tried using disk utility and didn’t seem to get anywhere. Using linux’s dd command seems to work best. Step 1. Open up the Terminal app and enter in: diskutil list Figure out what your usb device is called – mine was called /dev/disk1. Step 2. Unmount the disk: diskutil unmountDisk /dev/disk1 Step 3. Copy […]
Threading Example in Python
Running multiple threads in Python is actually quite simple:
Painless Django Settings.py Deployments
Instead of constantly changing settings.py for different environment, automate the the process with some simple python: