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
#----------------------------------------------- | |
# screen の下のラインに打ったコマンドを表示 | |
#----------------------------------------------- | |
if [ "$TERM" = "screen" ]; then | |
chpwd () { echo -n "^[_`dirs`^[\\" } | |
preexec() { | |
# see [zsh-workers:13180] | |
# http://www.zsh.org/mla/workers/2000/msg03993.html | |
emulate -L zsh | |
local -a cmd; cmd=(${(z)2}) |
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
package main | |
import "fmt" | |
func div (x float32) func(float32) float32 { | |
return func(y float32) float32 { return x / y } | |
} | |
func main () { |
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
use strict; | |
use warnings; | |
my $array_ref = [1, 2]; | |
my $array_ref_string = scalar $array_ref; | |
$array_ref_string =~ s{\A ARRAY\( (\w+) \) \z}{$1}xms; | |
warn $array_ref_string; | |
warn join(',', $array_ref); |
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 -*- | |
from datetime import datetime | |
from fcache.cache import FileCache | |
import feedparser | |
from hypchat import HypChat | |
import hashlib | |
import os | |
import pytz | |
import time |
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
class Email(models.Model): | |
email = models.EmailField(max_length=75, help_text="メールアドレス") | |
is_primary = models.BooleanField(help_text="メインかどうか") | |
created_at = models.DateTimeField(auto_now_add=True, help_text="作成日") | |
updated_at = models.DateTimeField(auto_now=True, help_text="編集日") | |
def __unicode__(self): | |
primary = u" (メイン)" if self.is_primary else "" | |
return "%s%s" % (self.email, primary) |
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
var matoryosika = function () { | |
if ( jQuery('#hoge_search_result_196').length ) { | |
jQuery('.hoge_search_result_content').each(function () { | |
jQuery(this).html((jQuery(this).html().replace(/ - /g,''))); | |
}) | |
} | |
} | |
setInterval("matoryosika()", 300); |
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 -*- | |
require 'rubygems' | |
require 'net/dns' | |
# :nameservers に指定したのは、AWS Route53 で example.com のゾーン作った時に | |
# 自動で割り当てられたネームサーバ | |
resolver = Net::DNS::Resolver.new(:nameservers => "205.251.192.100") | |
# もちろん、example.com は僕の所有ドメインじゃないので、 | |
# 今回テストするにあたって適当に登録した |
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
/Users/vkgtaro/.rvm/gems/ruby-1.9.3-p374/gems/net-ssh-2.6.5/lib/net/ssh/config.rb:68:in `block in load': invalid byte sequence in US-ASCII (ArgumentError) | |
from /Users/vkgtaro/.rvm/gems/ruby-1.9.3-p374/gems/net-ssh-2.6.5/lib/net/ssh/config.rb:67:in `foreach' | |
from /Users/vkgtaro/.rvm/gems/ruby-1.9.3-p374/gems/net-ssh-2.6.5/lib/net/ssh/config.rb:67:in `load' | |
from /Users/vkgtaro/.rvm/gems/ruby-1.9.3-p374/gems/net-ssh-2.6.5/lib/net/ssh/config.rb:50:in `block in for' | |
from /Users/vkgtaro/.rvm/gems/ruby-1.9.3-p374/gems/net-ssh-2.6.5/lib/net/ssh/config.rb:50:in `each' | |
from /Users/vkgtaro/.rvm/gems/ruby-1.9.3-p374/gems/net-ssh-2.6.5/lib/net/ssh/config.rb:50:in `inject' | |
from /Users/vkgtaro/.rvm/gems/ruby-1.9.3-p374/gems/net-ssh-2.6.5/lib/net/ssh/config.rb:50:in `for' | |
from /Users/vkgtaro/.rvm/gems/ruby-1.9.3-p374/gems/net-ssh-2.6.5/lib/net/ssh.rb:221:in `configuration_for' | |
from /Users/vkgtaro/.rvm/gems/ruby-1.9.3-p374/gems/net-ssh-2.6.5/lib/net/ssh.rb:166:in `start' | |
from ssh.rb:5:in `<main>' |
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
{ | |
"run_list": [ | |
"recipe[pylon]" | |
], | |
"pylon": { | |
"unit": "observer" | |
} | |
} |
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
{ | |
"run_list": [ | |
"recipe[pylon]" | |
], | |
"override_attributes": { | |
"pylon": { | |
"unit": "observer" | |
}, | |
} | |
} |