build=`uname --hardware-platform`
apt-get install python-dev libjpeg62 libjpeg-dev libpng12-0 libpng-dev libfreetype6-dev
ln -s /usr/lib/${build}-linux-gnu/libjpeg.so /usr/lib
ln -s /usr/lib/${build}-linux-gnu/libz.so /usr/lib
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
import optparse | |
from mandrill import Mandrill | |
from mandrill import UnknownTemplateError | |
def sync_templates(source_key, destination_key, update_existing=True, dry_run=False): | |
def perform_action(action): | |
'''Simple wrapper to skip actaully doing anything if dry run is enabled. |
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
import argparse | |
import cloudfiles | |
from cloudfiles.connection import Connection | |
AUTH_URLS = ['uk_authurl', 'us_authurl'] | |
if __name__ == '__main__': |
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
import sys | |
from collections import defaultdict | |
import requests | |
file_name = sys.argv[1] | |
results = defaultdict(list) | |
with open(file_name) as f: |
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
from django.conf.urls import patterns, url | |
from django.contrib.contenttypes.models import ContentType | |
from appname1.views import PostListView, PostDetailView, \ | |
PostCreateView, PostDeleteView, PostUpdateView | |
from appname2.views import CommentListView,\ | |
CommentDetailView, CommentCreateView, CommentDeleteView, \ | |
CommentUpdateView | |
from models import Post |
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
<div id="fb-root"></div> | |
<script> | |
var fbAppId = '< APP ID >'; | |
(function(){ | |
var fbInitFuncs = []; | |
var fbInitialized = false; | |
window.fbAsyncInit = function() { |
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
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
This stuff will be native in Rails 3.1 and the layout of the files on the | |
filesystem will be different but this guide will get you working with it | |
while we wait for all that to finalize. | |
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist. | |
It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention |
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
class CarmenCountryInput < SimpleForm::Inputs::PriorityInput | |
def input | |
@builder.send(:"country_select", attribute_name, input_options, input_html_options) | |
end | |
end |
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
$.extend($.validator.messages, { | |
required: "can't be blank", | |
remote: 'needs to get fixed', | |
email: 'is an invalid email address', | |
url: 'is not a valid URL', | |
date: 'is not a valid date', | |
dateISO: 'is not a valid date (ISO)', | |
number: 'is not a valid number', | |
digits: 'needs to be digits', | |
creditcard: 'is not a valid credit card number', |
NewerOlder