Skip to content

Instantly share code, notes, and snippets.

View cansadadeserfeliz's full-sized avatar

Vera cansadadeserfeliz

  • Desparchado.co
  • Bogotá
View GitHub Profile
@timmyomahony
timmyomahony / nginx.conf
Created June 26, 2011 13:29
Python, UWSGI, Supervisor & Nginx
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;
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- 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>
-->
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@varemenos
varemenos / getparam.js
Created April 29, 2012 03:50 — forked from alkos333/gist:1771618
JQuery - GET URL Parameter value
// 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]) || "";
}
@relekang
relekang / util.py
Created May 28, 2012 21:13
Expire @cache_page in django
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()
"""
@cyface
cyface / child_create.html
Created July 21, 2012 22:29
Django Many-To-Many Create With Intermediary (Through) Table
{% 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>
@andrefsp
andrefsp / gist:5115772
Last active March 1, 2021 22:22
Simple way to inject custom parameters on a Django formset without using django.utils.functional.curry()
"""
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
"""
@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# 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)"
@ViktorStiskala
ViktorStiskala / .gitconfig
Created August 13, 2013 13:27
Pycharm as a default git difftool and git mergetool. Add the following to ~/.gitconfig
[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"
@missinglink
missinglink / google-analytics-node.js
Created December 5, 2013 18:24
An example of how to generate Google Analytics reports from node.js (with custom dimensions).
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]",