Skip to content

Instantly share code, notes, and snippets.

@mt3
mt3 / pandas-heroku.md
Created September 8, 2012 23:10 — forked from nicolashery/pandas-heroku.md
Deploy Python app using Pandas on Heroku

Deploy Python app using Pandas on Heroku

2012-09-08

This document explains how to deploy a Python app that uses the Pandas library on Heroku.

Heroku builds Numpy (one of Pandas' requirements) fine. However, when trying to deploy an app with both numpy and pandas in its requirements.txt file (or even just pandas), for some reason it fails

@mt3
mt3 / friends_recommender_exp.py
Created September 3, 2012 19:09 — forked from marcelcaraciolo/friends_recommender_exp.py
friends recommender with explanations
#-*-coding: utf-8 -*-
'''
This module represents the recommender system for recommending
new friends based on 'mutual friends'.
'''
__author__ = 'Marcel Caraciolo <[email protected]>'
@mt3
mt3 / gist:3036016
Created July 2, 2012 22:03 — forked from ttscoff/gist:899757
demo script of ttscoff's pinboard backup sync
#!/usr/bin/ruby
%w[fileutils ftools set zlib].each do |filename|
require filename
end
# Load the Marshal dump to a hash
def load file_name
begin
file = Zlib::GzipReader.open(file_name)
@mt3
mt3 / cocoa_keypress_monitor.py
Created June 30, 2012 13:27 — forked from ljos/cocoa_keypress_monitor.py
Showing how to listen to all keypresses in OS X through the Cocoa API using Python and PyObjC
# cocoa_keypress_monitor.py by Bjarte Johansen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
from AppKit import NSApplication, NSApp
from Foundation import NSObject, NSLog
from Cocoa import NSEvent, NSKeyDownMask
from PyObjCTools import AppHelper
class AppDelegate(NSObject):
def applicationDidFinishLaunching_(self, notification):
mask = NSKeyDownMask
@mt3
mt3 / CGAffineTransform in jscocoa
Created June 25, 2012 20:37 — forked from ku/CGAffineTransform in jscocoa
iview transform js test
var anim = 1;
if ( anim ){
UIView.beginAnimations_context(null, null);
UIView.setAnimationDuration(0.4)
}
var orientation = 1;
var x = TransitionView.image.image.size.width;
@mt3
mt3 / flaskapp.py
Created June 21, 2012 10:10 — forked from kennethreitz/flaskapp.py
My typical flask app base
# -*- 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
@mt3
mt3 / gist:2962067
Created June 20, 2012 20:38
Parses a delicious.com bookmark file and transforms it into a list of dictionaries.
#!/usr/bin/env python
#coding:utf-8
# Author: --<>
# Purpose:
# Created: 12/29/10
from HTMLParser import HTMLParser # Python 2
# from html.parser import HTMLParser # Python 3
@mt3
mt3 / codewall.badges.js
Created June 19, 2012 09:13 — forked from marcinbunsch/codewall.badges.js
Coderwall - display missing badges
// How to use this:
// 1. Go to the desired profile page on coderwall, like http://coderwall.com/marcinbunsch
// 2. Paste this gist in the JS console
//
// You can also probably use this in greasemonkey and dot.js
//
// Also, it was tested in Chrome, Firefox and Safari, it probably will
// not work in IE, but I just don't care about it ;)
//
// UPDATE: Coderwall made changes to the site and I cannot retrieve the achievements, so they are hardcoded, taken from a cached version of the achievements page
@mt3
mt3 / letter_renderer.py
Created June 10, 2012 19:25
Jinja2 letter template example
#!/usr/bin/env python
#encoding=utf-8
"""
Seth Brown
Python 3.2
Blog post link: http://j.mp/H5Zrdn
"""
import os, sys, csv
from glob import iglob
from subprocess import Popen, PIPE
@mt3
mt3 / gist:2781226
Created May 24, 2012 12:17 — forked from axelav/linux-directory-structure.md
Quick summary of Linux directory hierarchy

Linux directory heirarchy

/bin binaries, basic Linux commands are here
/boot boot code, leave it be
/dev all devices/hardware, all treated as a stream
/etc config files & resources, only root user can modify
/home user account info & personal files
/lib shared library files essential for binaries
/lost+found stray files that can be recovered after a crash
/media mount points for removable media