Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+X | delete line |
Ctrl+↩ | insert line after |
Ctrl+⇧+↩ | insert line before |
Ctrl+⇧+↑ | move line (or selection) up |
"""Python boilerplate for using Twitter API w/OAuth, based on sixohsix-twitter. | |
As of 2010-08-31, Twitter has shut down Basic Auth completely. | |
You must use OAuth instead. This boilerplate does just that. | |
http://dev.twitter.com/pages/basic_auth_shutdown | |
This Python script uses the Python twitter package by Mike Verdone et al. | |
http://pypi.python.org/pypi/twitter | |
http://mike.verdone.ca/twitter/ |
from datetime import datetime | |
from flask import * | |
from flaskext.wtf import * | |
from flaskext.sqlalchemy import * | |
from werkzeug import generate_password_hash, check_password_hash | |
app = Flask() | |
app.config.from_pyfile('app_settings.py') | |
db = SQLAlchemy(app) |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+X | delete line |
Ctrl+↩ | insert line after |
Ctrl+⇧+↩ | insert line before |
Ctrl+⇧+↑ | move line (or selection) up |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
Options +FollowSymLinks | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] |
Lately, I have been looking into Python CMSs. There are many out there, but for some reason or another Mezzanine stuck out as one I should try. Installing it is easy enough, but getting it up on running on my new favorite host, Heroku, was a bit of a challege.
Below you will find the steps that I took to get Mezzanine up and running on Heroku. Please let me know in the comments below if anything didn't work for you.
Heroku is shortly depricating Django's standard DATABASES
dictionary in favor for a package which takes OS Environment Variables and builds the required dictionary for you. This is a good thing because it makes setting up a database on Heroku very easy. The package is called dj_database_url
and it makes short work of getting a PostgreSQL database up and running with Mezzanine. Below is the code that you want to put in Mezzanine's DATABASES
section:
import dj_database_url
DATABASES = {'default': dj_database_url.config(default='postgres://localhost')}
function testWebGL() { | |
try { | |
return !!window.WebGLRenderingContext && !!document.createElement('canvas').getContext('experimental-webgl'); | |
} catch(e) { | |
return false; | |
} | |
} | |
Modernizr.load([ | |
{ |
#!/usr/bin/env python | |
import os | |
import sys | |
import app | |
try: | |
from setuptools import setup | |
except ImportError: |
$ cd /tmp | |
$ curl -O http://python.org/ftp/python/X.Y.Z/Python-X.Y.Z.tgz | |
$ tar zxf Python-X.Y.Z.tgz | |
$ cd Python-X.Y.Z | |
$ ./configure --prefix=/usr/local/python/X.Y.Z | |
$ make | |
$ make install | |
$ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | /usr/local/python/X.Y.Z/bin/python | |
$ /usr/local/python/X.Y.Z/bin/easy_install pip | |
$ /usr/local/python/X.Y.Z/bin/pip install virtualenv |
After the success of our last meetup, Hack Night, we are continuing the trend with a different kind of meetup, Office Hours.
This is a casual "geek gathering", where you can hack on a node.js project, get help/advice, or ask questions about anything node.js related. Anyone working with node.js at any level (or anyone wanting to work with it) is welcome.
Our meetups are always filled with a mix of people and skills present, and I expect this to be the same. So feel free to bring your questions pertaining to system admin/dev ops, best practices, installation issues, etc.
We are also looking for food/drink sponsors in exchange for five to ten minutes of air time to announce your product/hiring/etc. Contact Josh Finnie for details.
Attendance is free, and food and drink will be provided if we have found some sponsors. For this reason, it is mandatory that you keep your RSVP up to date. The deadline for changing your mind will be one day before the event.