putting this file in ~/.ipython/profile_default/startup/shortcuts.py will change bindings for ctrl-w and shift+left/right arrow to match fish's behaviour regarding word boundaries.
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 | |
# coding: utf-8 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
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 | |
# coding: utf-8 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
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
# installs PIL. PIL is rubbish to install because of broken | |
# dependencies on libjpeg etc, so we need to do some symlinking | |
class pil { | |
# libpng is already installed, and I don't care about libfreetype etc. | |
package { [ 'libjpeg-dev', 'zlib1g' ]: | |
ensure => 'installed' | |
} | |
file { '/usr/lib/libjpeg.so': |
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
#!/bin/bash -e | |
# opinionated Flask bootstrap script | |
# assumes you'll be using MySQL/PG, Fabric, Webassets, WTForms and Blueprints | |
# creates a virtualenv and an Alembic migrations system | |
# The script will halt on any error, and remove the project dir, if it created one | |
# accepts a single argument: a new directory name under which to create the project | |
# check that Python is installed | |
type python >/dev/null 2>&1 || { echo >&2 "Python doesn't appear to be installed. Aborting."; exit 1; } |
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
#!/bin/bash -e | |
# opinionated Flask bootstrap script | |
# assumes you'll be using MySQL, Fabric, and Blueprints | |
# creates a virtualenv and an Alembic migrations system | |
# The script will halt on any error, and remove the project dir if it created one | |
# accepts a single argument: a new directory name under which to create the project | |
# check that Python is installed | |
type python >/dev/null 2>&1 || { echo >&2 "Python doesn't appear to be installed. Aborting."; exit 1; } |
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
*~ | |
*.pyc | |
.vagrant | |
venv |
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
Setup apache status | |
- sudo a2enmod status | |
- sudo nano /etc/apache2/conf.d/extendedstatus | |
- - Paste in 'ExtendedStatus On' | |
- sudo nano /etc/apache2/sites-available/xxx.com | |
Paste in... | |
<VirtualHost *:80> | |
ServerName status.ws1.xxx.com | |
ServerAlias status.ws1.xxx.com |
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
"""SQLAlchemy Metadata and Session object""" | |
import datetime | |
import json | |
import time | |
from sqlalchemy import MetaData | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
__all__ = ['Session', 'metadata', 'Model', 'SchemaEncoder'] |
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
# the following is a basically functional but probably broken for some cases (just tested for basic login ATM) implementation of a flask-security UserDataStore for RethinkDB. | |
# | |
# This is released as open source under the MIT license and comes with no warranty, yada yada. TODO: actual license header | |
from flask_security import UserMixin, RoleMixin | |
from flask_security.datastore import UserDatastore | |
import rethinkdb as r | |
class Bunch(object): | |
def __init__(self, obj, **kws): | |
self.__dict__.update(obj) |
OlderNewer