- Download Closure
- Place the java jar file within
/usr/local/libexec
- Create
/usr/local/bin/closure
, copy in the bash script shown below - Run
chmod +x /usr/local/bin/closure
Enjoy running closure
function Lazy(list, ...steps){ | |
this.list = list; | |
this.steps = steps; | |
} | |
Lazy.prototype.map = function(f){ | |
return new Lazy(this.list, ...this.steps, iteration | |
=> ( for (entry of iteration) f(entry))); | |
} |
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 |
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) |
import base64 | |
from django.utils import simplejson | |
import urllib | |
from google.appengine.api import urlfetch | |
def track(event, properties=None): | |
""" | |
A simple function for asynchronously logging to the mixpanel.com API on App Engine | |
(Python) using RPC URL Fetch object. | |
@param event: The overall event/category you would like to log this data under |
""" | |
A helper for the app engine blobstore API and Django. | |
Works with the appengine patch: | |
http://code.google.com/p/app-engine-patch/ | |
Taken and inspired by: | |
http://appengine-cookbook.appspot.com/recipe/blobstore-get_uploads-helper-function-for-django-request/ | |
Usage: |
application: yourappid | |
version: testgaesessions | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /stats.* | |
script: $PYTHON_LIB/google/appengine/ext/appstats/ui.py | |
- url: /.* | |
script: main.py |
#!/usr/bin/env ruby | |
# To use, put this in your bashrc: | |
# complete -C path/to/script -o default your_command_or_commands_here | |
# example, to complete the foo and bar commands with the foo.rb script: complete -C ~/bin/foo.rb -o default foo bar | |
prefix = ARGV[1] | |
words = `some command here, or just any array`.split.uniq | |
words = words.select {|w| /^#{Regexp.escape prefix}/ =~ w} if prefix |
$ git branch | |
* master | |
$ git feature my-new-feature | |
this will create a feature branch my-new-feature to be merged into master (Y/n): Y | |
$ git branch | |
* features/my-new-feature | |
master | |
$ # Do some work here, commit it... | |
$ git finish | |
this will integrate my-new-feature into master (Y/n): Y |
/usr/local/libexec
/usr/local/bin/closure
, copy in the bash script shown belowchmod +x /usr/local/bin/closure
Enjoy running closure
import sys, os | |
package_dir = "packages" | |
sys.path.insert(0, package_dir) | |
for filename in os.listdir(package_dir): | |
if filename.endswith((".zip", ".egg")): | |
sys.path.insert(0, "%s/%s" % (package_dir, filename)) |