create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
upstream uwsgi { | |
ip_hash; | |
server 127.0.0.1:40000; | |
} | |
server { | |
listen 80; | |
server_name www.domain.com; | |
root /sites/mysite/; | |
access_log /sites/mysite/log/nginx/access.log; |
<!-- Add the following lines to theme's html code right before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
// Given a query string "?to=email&why=because&first=John&Last=smith" | |
// getUrlVar("to") will return "email" | |
// getUrlVar("last") will return "smith" | |
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/ | |
function getUrlVar(key){ | |
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search); | |
return result && unescape(result[1]) || ""; | |
} |
from django.core.cache import cache | |
from django.core.urlresolvers import reverse | |
from django.http import HttpRequest | |
from django.utils.cache import get_cache_key | |
def expire_page_cache(view, args=None): | |
""" | |
Removes cache created by cache_page functionality. | |
Parameters are used as they are in reverse() | |
""" |
{% extends "base.html" %} | |
{% block content %} | |
<section title="Child Create" data-role="content"> | |
<h2>Child Create</h2> | |
<form action="{% url child_create slug=form.family_slug.value %}" method="POST"> | |
{{ form.errors }} | |
{% csrf_token %} | |
<ul> |
""" | |
Simple example on how to inject a custom user parameters onto a formset | |
and its forms. | |
curry(): https://github.com/django/django/blob/1.4.3/django/utils/functional.py#L9 | |
Another answer on: | |
http://stackoverflow.com/questions/622982/django-passing-custom-form-parameters-to-formset | |
""" |
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |
[diff] | |
tool = pycharm | |
[difftool "pycharm"] | |
cmd = /usr/local/bin/pycharm diff "$LOCAL" "$REMOTE" && echo "Press enter to continue..." && read | |
[merge] | |
tool = pycharm | |
keepBackup = false | |
[mergetool "pycharm"] | |
cmd = /usr/local/bin/pycharm merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED" |
var GA = require('googleanalytics'), | |
Table = require('cli-table'), | |
util = require('util'); | |
// API client. | |
// You may need to enable API access to analytics for your account | |
// here: https://code.google.com/apis/console | |
var ga = new GA.GA({ | |
"user": "[email protected]", |