Skip to content

Instantly share code, notes, and snippets.

View masahitojp's full-sized avatar
🎯
Focusing

Masato Nakamura masahitojp

🎯
Focusing
View GitHub Profile
// Template Tree
global.templateIDsByPath = global.templateIDsByPath || {
'404': undefined
}
// Get template for given path
const getComponentForPath = path => {
path = cleanPath(path)
return global.componentsByTemplateID[global.templateIDsByPath[path]]
}
PatternsSpec.scala
PoolSpec.scala
PipelineSpec.scala
@masahitojp
masahitojp / gist:ea91b3054c2574a89d9b486dc37c437c
Created June 13, 2018 10:19
OCaml: int_string to int List
# #load "str.cma";;
# List.map int_of_string (Str.split (Str.regexp "[^0-9]+") "1234");;
- : int list = [1234]
# List.map int_of_string (Str.split (Str.regexp "") "1234");;
- : int list = [1; 2; 3; 4]

Fabric2系のメモ

object detail
chage date 2018/5/12
version fabic 2.0.0
os ubuntu 18.04
python 3.6.5
swagger: '2.0'
info:
version: v2
title: YourName. API
host: yourname.nulab-inc.com
basePath: /api/v2
schemes:
- https
produces:
- application/json
@masahitojp
masahitojp / HelloWorld.scala
Last active November 4, 2017 03:42
minimum scala compile settings for gradle-scala
object HelloWorld {
def main(args: Array[String]): Unit = {
println("Hello, world!")
}
}
>>> from datetime import datetime
>>> from unittest import mock
>>> with mock.patch('__main__.datetime') as m:
... datetime.now() > datetime.now()
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
TypeError: '>' not supported between instances of 'MagicMock' and 'MagicMock'
@masahitojp
masahitojp / README.md
Created July 18, 2017 07:43
create test
$ python3 -v env this-folder
$ src this-folder/bin/activate
$ pip install python-lambda-local
$ python-lambda-local -f lambda_handler -t 5 handler.py event.json
@masahitojp
masahitojp / .gitconfig
Created July 7, 2017 02:59
my git aliases
[alias]
fetchp = fetch --prune
create-backlog-issue-branch = "!git checkout -b `pbpaste | sed -E 's/([a-zA-Z]+-[0-9]+) (.*)/\\1\\/\\2/g' | sed -e 's/ /-/g' | sed -e 's/\\\"//g'`"
push-current-branch = "!git push origin `git rev-parse --abbrev-ref HEAD`"
delete-merged-branch = "!git branch --merged | grep -v \\* | grep -v master | xargs -I % git branch -d %"
merge-origin = !sh -c 'git checkout $1 && git merge origin/"$1"' -

The Benefit of Type Hints


Masato Nakamura @ Nulab From Japan