Skip to content

Instantly share code, notes, and snippets.

View chrisdrackett's full-sized avatar
🐳

Chris Drackett chrisdrackett

🐳
View GitHub Profile
import urllib
import Image
from StringIO import StringIO
image_file = urllib.urlopen('http://ecx.images-amazon.com/images/I/31HFHT2Q56L.jpg')
raw_image = StringIO(image_file.read())
image = Image.open(raw_image)
rgb = image.convert('RGB')
(function(){
var events;
var check = function(e){
var target = $(e.target);
var parents = target.getParents();
events.each(function(item){
var element = item.element;
if (element != target && !parents.contains(element))
item.fn.call(element, e);
});
<snippet id="com.chrisdrackett.snippets.AutoField" category="actions.text.python/tools.Snippets.single">
<title>AutoField</title>
<text><![CDATA[${1:FIELDNAME} = models.AutoField()
$0]]></text>
<text-trigger>auto</text-trigger>
<syntax-context>sourcecode.python, sourcecode.python *</syntax-context>
</snippet>
<?xml version="1.0"?>
<action-categories>
<category id="actions.text.Django" show="sub">
<title>Django</title>
</category>
<category id="Django.Models" show="sub">
<title>Models</title>
</category>
<category id="Django.Forms" show="sub">
<title>Forms</title>
<snippet id="com.chrisdrackett.snippets.AutoField" category="actions.text.Django/Django.Models"
<title>AutoField</title>
<text><![CDATA[${1:FIELDNAME} = models.AutoField()
$0]]></text>
<text-trigger>auto</text-trigger>
<syntax-context>sourcecode.python, sourcecode.python *</syntax-context>
</snippet>
Warning: file_put_contents(database.xml) [function.file-put-contents]: failed to open stream: Permission denied in /home/fileabil/public_html/coffee/doupload.php on line 138
Warning: Cannot modify header information - headers already sent by (output started at /home/fileabil/public_html/coffee/doupload.php:138) in /home/fileabil/public_html/coffee/doupload.php on line 141
<?xml version="1.0"?>
<syntax name="text.html.django">
<zones>
<include syntax="text.html.basic" />
<include syntax="text.django.template" />
</zones>
</syntax>
import django.dispatch
pizza_done = django.dispatch.Signal(providing_args=["toppings", "size"])
# the below goes in yourapp/templatetags/app_tags.py
# --------------------------------------------------
from django import template
register = template.Library()
@register.inclusion_tag('path/to/template/template.html')
def list_items(items, item_type):
return {'item_type':item_type, 'list_items':items}
<li>
<a href="{% url registration_register %}" class="options_text">
<div class="link_content">
<div class="carrot">&gt;</div>
<div class="choice">Try to sign up again...</div>
<span>join page</span>
</div>
</a>
</li>