Skip to content

Instantly share code, notes, and snippets.

View gnzandrs's full-sized avatar

Gonzalo Vergara gnzandrs

View GitHub Profile
@sourcerebels
sourcerebels / README.txt
Created November 29, 2011 13:19
Atajos de teclado para Midnight Commander
Atajos de teclado de Midnight Commander
- Trabajar con paneles.
Alt+t: Cambia entre los diferentes modos de visualización de los paneles.
Control+r: Refresca ambos paneles.
Control+u: Intercambia los dos panels.
Control+s: Busca un fichero en el panel activo.
Alt+Shift+?: Buscar archivos en .
@remy
remy / trim-canvas.js
Last active May 3, 2024 13:39
Trims the surrounding transparent pixels from a canvas
// MIT http://rem.mit-license.org
function trim(c) {
var ctx = c.getContext('2d'),
copy = document.createElement('canvas').getContext('2d'),
pixels = ctx.getImageData(0, 0, c.width, c.height),
l = pixels.data.length,
i,
bound = {
top: null,
@rctay
rctay / gist:527113
Created August 16, 2010 15:18
[django] check if db table exists
"""
Came up with this for satchmo's downloadable product migration, 0001_split.
"""
def db_table_exists(table, cursor=None):
try:
if not cursor:
from django.db import connection
cursor = connection.cursor()
if not cursor:
raise Exception