Skip to content

Instantly share code, notes, and snippets.

View yinhm's full-sized avatar
🎯
Focusing

yinhm yinhm

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python
# Usage:
# This script will generate two files(vpnup and vpndown) after executing.
# Do chmod a+x on the two newly created files, and then move them to the
# openvpn config folder. then add the following two lines to the vpn config file:
# up vpnup
# down vpndown
# you might also need 'redirect-gateway' in the config file, if you don't use vpn
# as the default gateway.
@kpumuk
kpumuk / deploy.rb
Created November 18, 2009 10:03
Using bundled Jammit to precache assets in deploy.rb
namespace :deploy do
desc 'Bundle and minify the JS and CSS files'
task :precache_assets, :roles => :app do
root_path = File.expand_path(File.dirname(__FILE__) + '/..')
jammit_path = Dir["#{root_path}/vendor/gems/jammit-*/bin/jammit"].first
yui_lib_path = Dir["#{root_path}/vendor/gems/yui-compressor-*/lib"].first
assets_path = "#{root_path}/public/assets"
# Precaching assets
run_locally "ruby -I#{yui_lib_path} #{jammit_path}"
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