Skip to content

Instantly share code, notes, and snippets.

Taking care of my kid

Matt Wright mattupstate

Taking care of my kid
View GitHub Profile
mattupstate /
Created Dec 4, 2013
A generic window resize directive to which you can add to any element to call a function on your controller
.directive 'windowResize', ($window, $parse) ->
restrict: 'A'
link: (scope, element, attrs) ->
w = angular.element($window)
fn = $parse(attrs['windowResize'])
handler = (event) ->
mattupstate / gist:7010498
Created Oct 16, 2013
Flask-Mail Log Handler
View gist:7010498
import logging
from flask_mail import Message
class FlaskMailLogHandler(logging.Handler):
def __init__(self, mail, sender, recipients, subject, *args, **kwargs):
super(FlaskMailLogHandler, self).__init__(*args, **kwargs)
mattupstate / virtualbox.json
Created Sep 3, 2013
Ubuntu 12.04 VirtualBox Packer example
View virtualbox.json
"provisioners": [
"type": "shell",
"scripts": [
mattupstate / module.sublime-snippet
Created Jul 19, 2013
A simple Python module header snippet for Sublime Text
View module.sublime-snippet
<content><![CDATA[# -*- coding: utf-8 -*-
mattupstate /
Created Jun 25, 2013
Register all Blueprint instances on the specified Flask application found in all modules for the specified package
# -*- coding: utf-8 -*-
helpers module
import pkgutil
import importlib
mattupstate / Vagrantfile
Last active Dec 13, 2015
RabbitMQ cluster with Vagrant and Chef
View Vagrantfile do |vagrant|
vagrant.vm.define :vm1 do |config| = "precise64"
config.vm.box_url = "" :hostonly, ""
config.vm.host_name = 'rabbit1'
config.vm.provision :chef_solo do |chef|
chef.add_recipe "apt"
chef.add_recipe "hostsfile"
mattupstate / Scale to Fit.jsx
Created Aug 22, 2012
Photoshop script to scale an image to fill a specified rectangle and preserve aspect ratio. Save this in <Photoshop Install Folder>/Presets/Scripts and restart Photoshop.
View Scale to Fit.jsx
#target photoshop
main ();
function cloneRectangle(rect) {
return { x:rect.x, y:rect.y, width:rect.width, height:rect.height };
function rectangle(x, y, width, height) {
return { x:x, y:y, width:width, height:height };
View configure_nginx.yml
- hosts: testing
user: ubuntu
sudo: True
- software/nginx/vars/default.yml
mattupstate /
Created Apr 19, 2012
Super simple supervisor init.d script
# Supervisord auto-start
# description: Auto-starts supervisord
# processname: supervisord
# pidfile: /var/run/
DESC="supervisod is a system for controlling process state"
mattupstate /
Created Mar 15, 2012
Flask application configuration using an environment variable and YAML
from flask_extended import Flask
app = Flask(__name__)
app.config.from_yaml(os.join(app.root_path, 'config.yml'))
You can’t perform that action at this time.