Post data to url:
curl -d "k1=v1&k2=v2" http://example.com/
Post multipart form data to url:
curl -F "photo=@test_image.jpg" -F "k1=v1" -F "k2=v2" http://example.com/
/* ----------------------- | |
clearfix | |
from http://perishablepress.com/press/2008/02/05/lessons-learned-concerning-the-clearfix-css-hack/ | |
*/ | |
.group:after { | |
visibility: hidden; | |
display: block; | |
font-size: 0; | |
content: " "; | |
clear: both; |
# -*- coding: utf-8 -*- | |
''' | |
Borrowed from Django CMS. This is too useful to live without | |
''' | |
from django.conf import settings | |
class NULL: | |
pass |
cat /proc/version |
<!-- Carousel --> | |
<div id="carousel" class="feature autorotate slidelinks group"> | |
<!-- Slides --> | |
<div class="carousel-slides"> | |
<div class="slide"> | |
<a href="/bundles/greatest-need/"><img src="//www.gfamedia.org/images/bundles-slide/greatest-need.jpg" alt=""></a> | |
</div> | |
<div class="slide"> |
<!DOCTYPE HTML> | |
<!-- zero-timeout.html, L. David Baron <[email protected]>, 2010-03-07, 2010-03-09 --> | |
<!-- | |
Copyright (c) 2010, The Mozilla Foundation | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are |
Post data to url:
curl -d "k1=v1&k2=v2" http://example.com/
Post multipart form data to url:
curl -F "photo=@test_image.jpg" -F "k1=v1" -F "k2=v2" http://example.com/
try: | |
variable_name = re.search("as (\w+)", token.contents).group(1) | |
except AttributeError: | |
raise template.TemplateSyntaxError, \ | |
"%r tag had invalid arguments." % token.split_contents()[0] |
try: | |
contents = urllib2.urlopen(url).read() | |
except urllib2.HTTPError, exc: | |
# handle exception | |
pass | |
mymodel.image.save(file_name, ContentFile(contents)) |
""" | |
WSGI application configuration. | |
Read http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango to learn | |
more about integrating with Django. | |
""" | |
import os | |
import site | |
import sys |
#!/bin/sh | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |