Skip to content

Instantly share code, notes, and snippets.

View Chavao's full-sized avatar
💻
Coding...

Diego Chavão Chavao

💻
Coding...
View GitHub Profile
@scorphus
scorphus / mobprog.md
Last active January 24, 2022 19:09
The Dynamics of Mob Programming

The Dynamics of Mob Programming

In a nutshell

![dynamics of mob programming][mobprog.svg]

Before you start:

  • Make sure you have [whatchexec][] installed
  • Checkout the working branch
@millermedeiros
millermedeiros / gist:3057782
Created July 6, 2012 02:52
Links sobre otimização de performance (WPO)
<?php
/**
* Calculate your age
*
* @param DateTime $birthday Your birthday
*
* @return int
*/
function calculateAge(DateTime $birthday) {
@fnando
fnando / gist:2420869
Created April 19, 2012 13:10
My JavaScript Guidelines
@raelmax
raelmax / django_pagination.html
Created July 18, 2011 17:22
With this codesnippet your pagination don't show all page links, only two next pages and two previous pages, don't creating monstrous list of pages! :)
{% if is_paginated %}
<nav id="pagination">
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}">previous page</a>
{% endif %}
{% for page in page_obj.paginator.page_range %}
{% if page >= page_obj.number|add:"-2" and page < page_obj.number %}
<a href="?page={{ page }}">{{ page }}</a>
{% endif %}
{% ifequal page_obj.number page %}
@henriquebastos
henriquebastos / route.py
Created November 2, 2010 21:11
Route is a better urls function.
# -*- encoding: utf-8 -*-
# Usage:
# urlpatterns += patterns('',
# route(r'^$', GET='getview', POST='postview', name='viewname'),
# )
#
from django.http import Http404
from django.core.urlresolvers import RegexURLPattern, get_callable
def discover_view(view, prefix=''):