Skip to content

Instantly share code, notes, and snippets.

@mt3
mt3 / taskpaper .vimrc
Created April 8, 2012 11:04 — forked from narbs/taskpaper .vimrc
Adds "@done YY-MM-DD" to taskpaper notes edited in Vim
:fu! Taskpaper()
:return setline(line("."), getline(line(".")) . "@done(" . strftime("%Y-%m-%d") . ")")
:endf
:map <F11> <ESC>:call Taskpaper()<CR><ESC>
:imap <F11> <ESC>:call Taskpaper()<CR><ESC>
@mt3
mt3 / add_users.py
Created April 14, 2012 04:58 — forked from imlucas/add_users.py
Using Amazon Cloudsearch with Python and Boto
from cloudsearch import connect_cloudsearch, get_document_service
endpoint = 'paste your doc service endpoint here'
service = get_document_service(endpoint=endpoint) # Get a new instance of cloudsearch.DocumentServiceConnection
# Presumably get some users from your db of choice.
users = [
{
'id': 1,
@mt3
mt3 / gist:2781208
Created May 24, 2012 12:14 — forked from axelav/gist:1839777
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@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
@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 / 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 / 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 / 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 / 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 / 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