create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
<?php | |
class IndexController extends Zend_Controller_Action | |
{ | |
public function exportXlsAction() | |
{ | |
set_time_limit( 0 ); | |
$model = new Default_Model_SomeModel(); | |
$data = $model->getData(); |
#!/usr/bin/env/python | |
# | |
# More of a reference of using jinaj2 without actual template files. | |
# This is great for a simple output transformation to standard out. | |
# | |
# Of course you will need to "sudo pip install jinja2" first! | |
# | |
# I like to refer to the following to remember how to use jinja2 :) | |
# http://jinja.pocoo.org/docs/templates/ | |
# |
# LICENSE: public domain | |
def calculate_initial_compass_bearing(pointA, pointB): | |
""" | |
Calculates the bearing between two points. | |
The formulae used is the following: | |
θ = atan2(sin(Δlong).cos(lat2), | |
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong)) |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
//lsauer.com 2012 | |
//description: comprehensive list of MIME types / subtypes as a tab-separated flatfile | |
//source: W3C | |
extension mime | |
.3dm x-world/x-3dmf | |
.3dmf x-world/x-3dmf | |
.a application/octet-stream | |
.aab application/x-authorware-bin | |
.aam application/x-authorware-map |
A warning occurred (42 apples) | |
An error occurred |
"""Add user created_by and modified_by foreign key refs to any model automatically. | |
Almost entirely taken from https://github.com/Atomidata/django-audit-log/blob/master/audit_log/middleware.py""" | |
from django.db.models import signals | |
from django.utils.functional import curry | |
class WhodidMiddleware(object): | |
def process_request(self, request): | |
if not request.method in ('GET', 'HEAD', 'OPTIONS', 'TRACE'): | |
if hasattr(request, 'user') and request.user.is_authenticated(): | |
user = request.user |
$ redis-cli | |
> config set stop-writes-on-bgsave-error no |
alias dj="python manage.py" | |
alias djdd="python manage.py dumpdata" | |
alias djld="python manage.py loaddata" | |
alias djm="python manage.py migrate" | |
alias djsh="python manage.py shell" | |
alias djsm="python manage.py schemamigration" | |
alias djs="python manage.py syncdb --noinput" | |
alias djt="python manage.py test" | |
alias djrs="python manage.py runserver" |
git rebase --interactive HEAD~2 | |
# we are going to squash c into b | |
pick b76d157 b | |
pick a931ac7 c | |
# squash c into b | |
pick b76d157 b | |
s a931ac7 c |