This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
names: ["irpe", "Irpe"], | |
icon: "http://ir.pe/favicon.ico", | |
description: "Replaces a url with a short ir.pe one.", | |
help: "irpe url", | |
author: {name: "Jesús Del Carpio", email: "jjdelc@gmail.com"}, | |
license: "GPL", | |
homepage: "http://isgeek.net/", | |
arguments: [{role: 'object', nountype: noun_arb_text}], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -crB django_extensions/db/fields/__init__.py /home/jj/programas/django/extras/django-extensions/django_extensions/db/fields/__init__.py | |
*** django_extensions/db/fields/__init__.py 2010-07-05 16:15:30.000000000 -0500 | |
--- /home/jj/programas/django/extras/django-extensions/django_extensions/db/fields/__init__.py 2010-07-05 16:23:38.000000000 -0500 | |
*************** | |
*** 67,91 **** | |
self._populate_from = (self._populate_from, ) | |
slug_field = model_instance._meta.get_field(self.attname) | |
- slug_for_field = lambda field: self.slugify_func(getattr(model_instance, field)) | |
if add or self.overwrite: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
names: ["Goo.gl", "shorten"], | |
description: "Shorten a URL using Google's shortener", | |
help: "Just use the url as the parameter", | |
author: { | |
name: "Jj", | |
email: "jjdelc@gmail.com", | |
homepage: "http://isgeek.net/", | |
}, | |
license: "GPL", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from random import sample | |
class RandomObjectManager(object): | |
""" | |
Manager Mixin to implement get_random() in your models. | |
You can override get_objects to tune the queriset | |
To use, define your class: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function($){ | |
ListFilterCollapsePrototype = { | |
bindToggle: function(){ | |
var that = this; | |
this.$filterEl.click(function(){ | |
that.$filterList.slideToggle(); | |
}); | |
}, | |
init: function(filterEl) { | |
this.$filterEl = $(filterEl).css('cursor', 'pointer'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Resize all pictures in a folder | |
# | |
# This will modify the files, so MAKE A BACKUP before! | |
# | |
# usage: | |
# $> resizem.sh folder/name | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"hex": "#EFDECD", | |
"name": "Almond", | |
"rgb": "(239, 222, 205)" | |
}, | |
{ | |
"hex": "#CD9575", | |
"name": "Antique Brass", | |
"rgb": "(205, 149, 117)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Run this to serve a temporary upload/download page from your computer. | |
I use this to transfer files directly between my phone and any of my PCs. The | |
benefit over Dropbox or Syncthings is that this is direct and immediate. | |
No fuzz, no installation, no usernames. Just directly deposit the file. I | |
haven't tested this for very large files. |