Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Masato Nakamura masahitojp

🎯
Focusing
View GitHub Profile
@masahitojp
masahitojp / HelloWorld.scala
Last active Nov 4, 2017
minimum scala compile settings for gradle-scala
View HelloWorld.scala
object HelloWorld {
def main(args: Array[String]): Unit = {
println("Hello, world!")
}
}
View gist:ff84c37b7ae1b9430005e536d60f43cc
>>> 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'
View README.md
$ 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
View .gitconfig
[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"' -
View pycontw2017.md

The Benefit of Type Hints


Masato Nakamura @ Nulab From Japan

Coffee<script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>

View pycontw.md

The Benefit of Type Hints


Masato Nakamura @ Nulab From Japan

Coffee<script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>

@masahitojp
masahitojp / HelloLucene.java
Last active Jun 11, 2017
apache lucene入門 第一章のプログラムをLucene6.5.xで動くようにしてみた
View HelloLucene.java
package com.github.masahitojp;
/*
This program based on Apache Lucene入門
*/
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.ja.JapaneseAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
@masahitojp
masahitojp / Test.java
Created Jan 5, 2017
Guice to set injector setter
View Test.java
package com.github.masahitojp;
import com.github.masahitojp.provider.ClockProvider;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.junit.Before;
import org.junit.Test;
import java.time.Clock;
You can’t perform that action at this time.