This file contains hidden or 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
| (defn read-as-byte-array [filename] | |
| (with-open [fis (java.io.FileInputStream. filename)] | |
| (let [channel (.getChannel fis) | |
| byte-buf (java.nio.ByteBuffer/allocate 100000)] | |
| (.read channel byte-buf) | |
| byte-buf))) |
This file contains hidden or 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
| $ convert A.png -distort Affine '10,10 3,5' B.png |
This file contains hidden or 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 ( | |
| "code.google.com/p/goauth2/oauth" | |
| "fmt" | |
| "google.golang.org/api/drive/v2" | |
| "log" | |
| "net/http" | |
| "os" | |
| ) |
This file contains hidden or 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
| #!/bin/sh | |
| # 参考 Commit Hash から、該当 Pull Request を見つける方法 - Qiita https://qiita.com/awakia/items/f14dc6310e469964a8f7 | |
| GITHUB_URL=`git config --get remote.origin.url | sed -E 's#^.+(github.com):(.+)\.git$#https://\1/\2#'` | |
| git log --merges --oneline --reverse --ancestry-path $1...master | grep -m 1 "Merge pull request" | cut -f5 -d ' ' | sed "s@#@${GITHUB_URL}/pull/@" |xargs open |
This file contains hidden or 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
| (ns sandbox.tree | |
| "『集合知プログラミング』の7章を読んで決定木をプログラミングする") | |
| ;; https://resources.oreilly.com/examples/9780596529321/blob/master/PCI_Code%20Folder/chapter7/treepredict.py | |
| (def my-data [["slashdot","USA","yes",18,"None"], | |
| ["google","France","yes",23,"Premium"], | |
| ["digg","USA","yes",24,"Basic"], | |
| ["kiwitobes","France","yes",23,"Basic"], | |
| ["google","UK","no",21,"Premium"], | |
| ["(direct)","New Zealand","no",12,"None"], |
This file contains hidden or 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
| $ go version | |
| go version go1.10.2 darwin/amd64 | |
| $ go get -u golang.org/x/vgo | |
| $ vgo version | |
| go version go1.10.2 darwin/amd64 vgo:2018-02-20.1 | |
| $ mkdir test_vgo | |
| $ cd test_vgo | |
| $ echo >go.mod | |
| $ wget https://gist.githubusercontent.com/deltam/14e44c5adff91e723d2036f5f8e7ac25/raw/8048a89bb73c3bf719f5d830917ee3673b52170e/main.go | |
| $ vgo build |
This file contains hidden or 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
| #!/bin/sh | |
| # for mac | |
| function message() { | |
| m=$1" "`date "+%H:%M"` | |
| osascript -e "display notification \"$m\" with title \"pomodoro notice\"" | |
| echo $m | |
| say $m | |
| } |
This file contains hidden or 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
| // どんな型の配列だろうが添字はintという発想から汎用データ構造みたいなのが作れないか試してみた | |
| // 配列は削除が面倒なのでmapで任意の構造体を持つ | |
| // intキー:任意の型でintキーだけデータ構造で管理しとく | |
| // とりあえずStack | |
| package main | |
| import "fmt" | |
| func main() { |
This file contains hidden or 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
| (ns sandbox.changelog | |
| (:require [clojure.string :refer [split blank? includes?]] | |
| [clojure.java.io :refer [reader]])) | |
| (def df (java.text.SimpleDateFormat. "yyyy-MM-dd")) | |
| (defn header? [line] | |
| (not (nil? (re-find #"^\d{4}-\d{2}-\d{2}" line)))) | |
| (defn parse-header [line] |
This file contains hidden or 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
| 034 898b9418ec135df4dde0fc0ca2aa90c2e327a101 | |
| 033 0b8d8d7e0e6245f16612d3f5920becdf6baf8007 | |
| 032 584733d3a39c7b7a7f04519a76838187820216ca | |
| 031 d0669f2acc9022c9ad9ba2554ee2b02f2e9153e7 | |
| 030 275fe432e327301f17b5db8a02aef80de1830336 | |
| 029 7dd4050fedf8849a4b4387b2cd065d9478e921e2 | |
| 028 717725b4d56a19047d7c33edc4139831a26b8741 | |
| 027 0458a9e1637efaa2b0977e8113ef3266e6ffc674 | |
| 026 a1a6c5c7f1d431c02442f183050337130570b56e | |
| 025 f3eba146e2fe0510b6cf13f25b07a3ebc4c10732 |