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 pyramid.i18n import make_localizer, TranslationString | |
dir = '/your/locale/dir' | |
directories = (dir,) | |
txt_want_to_translate = TranslationString('hoge_moge') | |
# txt_want_to_translate = TranslationString('hoge_moge', domain='some_domain') | |
locale = 'ja' | |
localizer = make_localizer(locale, directories) | |
transltaed_str = localizer.translate(txt_want_to_translate) |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import gevent | |
from gevent.event import AsyncResult | |
from gevent.queue import Queue | |
__all__ = ('GExecutorNotRunningError', 'GExecutor') | |
class GExecutorNotRunningError(Exception): |
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 pprint | |
print '----try not append----' | |
a = [] | |
print 'object id of variable \'a\' => %d' % id(a) | |
print 'content of variable \'a\': %s' % pprint.pformat(a) | |
a = a + [1] | |
print 'added value 1 with + operator' | |
print 'object id of variable \'a\' has changed: %d' % id(a) | |
print 'content of variable \'a\': %s' % pprint.pformat(a) |
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
# coding: utf-8 | |
Vagrant.configure("2") do |config| | |
config.vm.hostname = "digital-ocean-test" | |
config.ssh.private_key_path = "~/.ssh/id_rsa" | |
config.vm.box = "digital_ocean" | |
config.vm.provider :digital_ocean do |provider| | |
provider.client_id = "YOUR CLIENT ID" | |
provider.api_key = "YOUR API KEY" |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import simplejson | |
import re | |
import pprint | |
import iso8601 | |
__all__ = ('FluentLogS3', 'parse_fluent_log_line') | |
_parse_pat = re.compile(r'\A(\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d[\-+]\d\d:\d\d)\s+([^\s]+)\s+(.*)\n\Z') |
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
$("#tagid").click(function(){ | |
var someAttr = $(this).attr("data-hoge-fuga"); | |
// do something | |
}); |
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
$("#tagid").text("here is new text for the tag"); |
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
$(function(){ | |
// do something onready | |
]}); |
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
escape | |
startup_message off | |
#attrcolor b ".I" | |
defbce on | |
term xterm-256color | |
termcapinfo xterm* ti@:te@ | |
termcapinfo xterm-256color 'is=J7h1;4;6l' | |
vbell off | |
hardstatus alwayslastline "%`%-w%{=b bw}%n %t%{-}%+w" | |
autodetach on |
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
setopt prompt_subst | |
setopt print_eight_bit | |
setopt no_flow_control | |
setopt hist_ignore_dups | |
setopt hist_reduce_blanks | |
#setopt share_history | |
HISTFILE=~/.zsh_history | |
HISTSIZE=10000 | |
SAVEHIST=10000 |