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 datetime | |
import pytz | |
# ロケールのないdatetimeにロケール情報を与える | |
d = datetime.datetime.now() # naiveなローカルな時刻を取得 | |
d2 = pytz.timezone("Asia/Tokyo").localize(d) | |
# ロケールを変更する | |
d3 = d2.astimezone(pytz.utc) |
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 functools import reduce | |
def concate(*args): | |
return reduce( | |
lambda func1, func2: lambda value: func2(func1(value)), | |
args | |
) |
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
Show hidden characters
{ | |
"presets": ["es2015"], | |
"plugins": ["transform-runtime"] | |
} |
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/env zsh | |
set -e | |
NODE_VERSION=$1 | |
nodebrew install-binary $NODE_VERSION | |
nodebrew use $NODE_VERSION | |
PACKAGES=( |
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/env zsh | |
set -e | |
NODE_VERSION=$1 | |
nodebrew install-binary $NODE_VERSION | |
nodebrew use $NODE_VERSION | |
PACKAGES=( |
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 models | |
type RuntimeError interface { | |
Param() interface{} // runtimeエラーが起こった祭のpanic()の引数を取得 | |
Error() string | |
} | |
type runtimeErrorImpl struct { | |
data struct { | |
param interface{} |
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" | |
"io/ioutil" | |
"os" | |
"github.com/ghodss/yaml" | |
) |
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
--- | |
- hosts: localhost | |
tasks: | |
- shell: "echo '{\"changed\": true}'" | |
register: result | |
changed_when: (result.stdout|from_json)["changed"] | |
- shell: "echo '{\"changed\": false}'" | |
register: result | |
changed_when: (result.stdout|from_json)["changed"] |
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
{ | |
"permissions" : { | |
"outputs" : [ "create", "edit", "terminate", "read" ], | |
"sources" : [ "read" ], | |
"indexranges" : [ "read", "rebuild" ], | |
"deflector" : [ "read", "cycle" ], | |
"loggers" : [ "readsubsystem", "edit", "editsubsystem", "read" ], | |
"inputs" : [ "terminate", "read", "create", "changestate", "edit" ], | |
"lbstatus" : [ "change" ], | |
"roles" : [ "edit", "create", "read", "delete" ], |
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" | |
"log" | |
"reflect" | |
"github.com/mitchellh/mapstructure" | |
"github.com/suzuki-shunsuke/go-set" | |
) |
OlderNewer