This file contains hidden or 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 __future__ import with_statement | |
import functools | |
import os | |
import sys | |
from fabric.api import * | |
from fabric.colors import green, red, green | |
import datetime | |
import re |
This file contains hidden or 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
/* | |
* grunt | |
* https://github.com/cowboy/grunt | |
* | |
* Copyright (c) 2012 "Cowboy" Ben Alman | |
* Copyright (c) 2012 John K. Paul @johnkpaul | |
* Licensed under the MIT license. | |
* http://benalman.com/about/license/ | |
*/ |
This file contains hidden or 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
deploy: dependencies check | |
# index must be clean (no modified files) | |
git diff-index --quiet --cached HEAD | |
# no uncomitted changes | |
git diff-files --quiet | |
# create a branch for the current version | |
git branch -f deploy_`grep -E '^version: ' app.yaml | cut -d ' ' -f 2` | |
# push current code to that branch | |
git push -f . deploy_`grep -E '^version: ' app.yaml | cut -d ' ' -f 2` |
This file contains hidden or 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 google.appengine.ext import db | |
from django.utils import simplejson | |
### Functions ### | |
def fetch_references(entities, attr): | |
"""Fetches and sets ReferenceProperty attributes in one db call""" | |
keys = [] | |
for entity in entities: | |
key = getattr(entity, '_' + attr) |
This file contains hidden or 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 python | |
import getopt | |
import os | |
import ae | |
import sys | |
import code | |
def usage(): | |
print """ |
This file contains hidden or 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 logging | |
from google.appengine.api import memcache | |
from google.appengine.api import apiproxy_stub_map | |
from google.appengine.datastore import datastore_pb | |
"""Provides a shim that caches datastore Get calls. | |
Example code: | |
import datastore_get_cache |
This file contains hidden or 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
$(document).ready(function() { | |
function sendInvites(fb_ids, selector) { | |
var link_url = "http://pinterest.com/invited/?code=41165921502368484"; | |
FB.ui({ | |
method: "send", | |
to: fb_ids, | |
name: "Join Pinterest, the Virtual Pinboard", | |
description: "Pinterest lets you organize and share all the beautiful things you find on the web. People use pinboards to plan their weddings, decorate their homes, and organize their favorite recipes.", | |
picture: "http://media-cache0.pinterest.com//images/favicon_red_250.png", | |
link: link_url |
This file contains hidden or 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 generateRandomKey(size) | |
{ | |
var keyset = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$.+-_$'; | |
var result = []; | |
for (var i = 0; i < size; i++) { | |
// todo: Math.random has issues and baggage: http://stackoverflow.com/questions/424292/how-to-create-my-own-javascript-random-number-generator-that-i-can-also-set-the | |
var rnum = Math.floor(Math.random() * keyset.length); | |
result[i] = keyset.substring(rnum, rnum + 1); | |
} | |
return result.join(''); |
This file contains hidden or 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 bash | |
openssl genrsa -out key.pem 2048 | |
openssl req -new -config request.cnf -x509 -key key.pem -out cert.pem -days 1095 |
This file contains hidden or 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
Show hidden characters
[ | |
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" }, | |
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" } | |
] |