MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。
2014年6月11日時点での情報。
- Version: CoreOS 343.0.0
- Kernel: 3.14.5
- Docker: 1.0
# ./config/initializers/asset_precompile_prefix_fix.rb | |
# | |
# So we can deploy at a SubURI, and precompile assets to respect that with: | |
# RAILS_RELATIVE_URL_ROOT=/foo rake assets:precompile | |
# | |
# See: http://stackoverflow.com/questions/7293918/broken-precompiled-assets-in-rails-3-1-when-deploying-to-a-sub-uri | |
# | |
# Confirmed working in Rails 3.1.3 | |
# Future versions of Rails may make this monkey patch unneccesary. (or break | |
# it without making it unneccesary) |
" ************************************************** | |
" Gist {{{ | |
" ************************************************** | |
" dictionary of Gist accounts. | |
let g:gist_accounts = { | |
\ 'user1': { | |
\ 'password': 'password' | |
\ }, | |
\ 'user2': { | |
\ 'password': 'password' |
#<site_root>/functions.py | |
from hyde.plugin import Plugin | |
def quoted(var): | |
return '"%s"' % var | |
class MyJinjaLoader(Plugin): | |
def template_loaded(self, template): |
<div class="wrapper"> | |
<div class="container"> | |
<header> | |
</header> | |
<div id="content"> | |
</div> | |
</div> | |
<div class="footer-push"></div> |
function! s:dash(...) | |
let word = len(a:000) == 0 ? input('Dash search: ') : a:1 | |
call system(printf("open dash://'%s'", word)) | |
endfunction | |
command! -nargs=? Dash call <SID>dash(<f-args>) |
# URI of the local (caching) HTTP proxy | |
LOCAL_HTTP_PROXY = 'http://192.168.33.200:8123' | |
# Configures vagrant-cachier and vagrant-proxyconf. | |
# Should be called only on "local machine" providers. | |
def configure_caching(config) | |
if Vagrant.has_plugin?('vagrant-cachier') | |
config.cache.enable_nfs = true | |
config.cache.enable :gem | |
config.cache.enable :npm |
#compdef tmuxinator mux | |
# zsh completion for tmuxinator | |
# Install: | |
# $ mkdir -p ~/.tmuxinator/completion | |
# $ cp _tmuxinator ~/.tmuxinator/completion | |
# $ vi ~/.zshrc # add the following codes | |
# fpath=($HOME/.tmuxinator/completion ${fpath}) | |
# autoload -U compinit |
class RestrictedSerializerOptions(serializers.ModelSerializerOptions): | |
""" | |
Meta class options for ModelSerializer | |
""" | |
def __init__(self, meta): | |
super(RestrictedSerializerOptions, self).__init__(meta) | |
self.writable_fields = getattr(meta, 'writable_fields', ()) | |
class WriteRestrictedModelSerializer(serializers.ModelSerializer): |
import urllib2 | |
class HeadRequest(urllib2.Request): | |
def get_method(self): | |
return "HEAD" | |
class HEADRedirectHandler(urllib2.HTTPRedirectHandler): | |
""" | |
Subclass the HTTPRedirectHandler to make it use our | |
HeadRequest also on the redirected URL |