Skip to content

Instantly share code, notes, and snippets.

// PostgreSQL
@GrabConfig(systemClassLoader=true)
@Grab('postgresql:postgresql:9.0-801.jdbc4')
def sql = groovy.sql.Sql.newInstance(
"jdbc:postgresql://host.example.org/database",
"username", "password", "org.postgresql.Driver")
// MySQL
@GrabConfig(systemClassLoader=true)
Esta son aplicaciones de django muy utiles, para como dice la filosofia de Instagram no reinventar la rueda :).
django-mingus
django-ratings
django-ajax-validation
django-google-analytics
@kaajavi
kaajavi / Nunca frenar grub
Last active August 29, 2015 14:04
Permite no frenar el grub
//UNICA LINEA QUE DICE '"${recordfail}" = 1'
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
por esto otro
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
set timeout=10
@kaajavi
kaajavi / gist:5f7d4bcd28df001d02b2
Last active August 29, 2015 14:19
Mostrar particiones del disco duro
sudo fixparts /dev/sda
$(window).on("scroll", function() {
var scrollHeight = $(document).height();
var scrollPosition = $(window).height() + $(window).scrollTop();
if ((scrollHeight - scrollPosition) / scrollHeight === 0) {
// when scroll to bottom of the page
}
});
@kaajavi
kaajavi / LOGS_ON_TWISTED.PY
Created September 23, 2015 01:11
Rotated file log twisted
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
An example of using the rotating log.
"""
from twisted.python import log
@kaajavi
kaajavi / gitignore para Django
Created October 2, 2015 13:22
Un gitignore personalizado para django
#Para django:
*.db
migrations/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
[code language=playonlinux]
#!/bin/bash
# This Script helps to instal >>Altium Designer 10, 2013, 2014<<
# Written by Robert Paulo
[ "$PLAYONLINUX" = "" ] && exit
source "$PLAYONLINUX/lib/sources"
#!/bin/bash
# Date : (2009-10-14 18-00)
# Last revision : (2009-10-14 18-00)
# Wine version used : 1.1.31
# Distribution used to test : Fedora 11
# Author : NSLW
# Licence : Retail
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
@kaajavi
kaajavi / gist:c963f18a37ef854a3e47
Created January 22, 2016 13:56
Example: "How to use multiple databases django"
You can easy do this by appearing custom attribute to model:
class A(models.Model):
_DATABASE = "X"
class B(models.Model):
_DATABASE = "X"
...