As configured in my dotfiles.
start new:
tmux
start new with session name:
| This code snippet, modifed from Mpanik's rundemo.cpp (r727, license LGPL), | |
| renders the State of California using USGS state boundaries data. | |
| Here's a play-by-play (via https://lists.berlios.de/pipermail/mapnik-devel/2008-August/000679.html) | |
| rundemo.cpp renders a map of Ontario/Quebec, and instead I wanted to draw a | |
| map of California and its surrounding states. | |
| I grabbed the data from the USGS in the form of "statesp020" (google it, or | |
| browse through nationalatlas.gov) and first wanted to modify rundemo.py |
| # Copyright (c) 2010 Curt Micol <[email protected]> | |
| # Permission to use, copy, modify, and distribute this software for any | |
| # purpose with or without fee is hereby granted, provided that the above | |
| # copyright notice and this permission notice appear in all copies. | |
| # THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
| # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
| # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
| # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
| # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| # | |
| # by default, django 404 and 500 pages dont pass context to templates. | |
| # as you almost *always* need context variables in your custom | |
| # 404/500 templates, you might need MEDIA_URL for example | |
| # | |
| # you need to create a custom view for errors and register it in your urls.py | |
| # | |
| # in urls.py add : | |
| # | |
| # handler500 = handler404 = views.server_error |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| #Quick cp from http://sekati.com/etc/install-nodejs-on-debian-squeeze | |
| # | |
| #Needed to install TileMill from MapBox | |
| # | |
| #Installs node.js which has npm bundled | |
| # | |
| #Build Dependencies | |
| sudo apt-get update && apt-get install git-core curl build-essential openssl libssl-dev |
| void SyncService::sync() | |
| { | |
| QUrl url(SYNC_URL); | |
| QNetworkRequest request(url); | |
| request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); | |
| QNetworkAccessManager *manager = new QNetworkAccessManager(this); | |
| connect(manager, SIGNAL(finished(QNetworkReply*)), |
| # Example usage... | |
| from admin_util import ImprovedModelForm | |
| class DialogAdmin(ImprovedModelForm): | |
| raw_id_fields = ("forum", "user", ...) # "forum" and "user" are ForeignKeys | |
| ... |
| var redis = require("redis") | |
| , subscriber = redis.createClient() | |
| , publisher = redis.createClient(); | |
| subscriber.on("message", function(channel, message) { | |
| console.log("Message '" + message + "' on channel '" + channel + "' arrived!") | |
| }); | |
| subscriber.subscribe("test"); |
| from Crypto.Cipher import AES | |
| from Crypto import Random | |
| BS = 16 | |
| pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) | |
| unpad = lambda s : s[0:-ord(s[-1])] | |
| class AESCipher: | |
| def __init__( self, key ): | |
| """ |
| [uwsgi] | |
| proj_name = %n | |
| # load variables | |
| ini = /var/local/django/%n/uwsgi/vars.ini | |
| ini = /etc/uwsgi/templates/include/vars.ini | |
| ini = /etc/uwsgi/templates/include/vars-shared.ini | |