Skip to content

Instantly share code, notes, and snippets.

@daxanya2
daxanya2 / Dockerfile
Last active November 23, 2016 23:30
Ubuntu14.04.3でnvidia-docker使ってCaffeをインストールしてみた ref: http://qiita.com/daxanya1/items/f04c7f75a6d2ecb92b23
FROM cuda:7.5_cudnn70
COPY Anaconda2-2.4.1-Linux-x86_64.sh /opt
# caffe makefile:use anaconda2 / use cudnn3
COPY Makefile.config /opt
# install anaconda2
RUN echo 'export PATH=/opt/anaconda2/bin:$PATH' > /etc/profile.d/conda.sh && \
cd /opt && \
@daxanya2
daxanya2 / wordmove.lua
Last active November 8, 2015 14:11
NYAGOSとconemuでキーボード操作の拡張 ref: http://qiita.com/daxanya1/items/7d4b51bba6c8f3a6016b
-- ref) http://stackoverflow.com/questions/17386792/how-to-implement-string-rfind-in-lua
nyagos.bindkey("M_A",
function(this)
local pos = (this.text:sub(1,this.pos-1)):match'.*() '
if pos and (pos < this.pos) then
for i = 1, this.pos-pos do
this:call("BACKWARD_CHAR")
end
else
this:call("BEGINNING_OF_LINE")
@daxanya2
daxanya2 / ESPWROOM02_RC522.ino
Created October 12, 2015 04:45
ESP-WROOM-02とRFID-RC522で非接触Lチカ ref: http://qiita.com/daxanya1/items/b9c2b971a946c8bf063e
/*
* ESP-WOORM-02とMFRC522を接続する
* 2015/10/12
*
* 配線(SPI通信):
*  ESP-WROOM-02 : MFRC522
* GPIO 5 -> SDA(1) - ESP-WROOM-02側はSS_PINで定義
* GPIO14 -> SCK(2)
* GPIO13 -> MOSI(3)
* GPIO12 <- MISO(4)
@daxanya2
daxanya2 / file1.txt
Last active August 29, 2015 14:05
【忙しい人向け】JavaScriptで3D物理エンジン動かしてみる (three.js + ammo.js) ref: http://qiita.com/daxanya1/items/79be9e0591b98196c376
sphere pos = 0.00,10.00,0.00
sphere pos = 0.00,9.99,0.00
sphere pos = 0.00,9.98,0.00
sphere pos = 0.00,9.97,0.00
:
sphere pos = 0.00,1.22,0.00
sphere pos = 0.00,1.00,0.00
@daxanya2
daxanya2 / example_colorfill.py
Created June 22, 2014 11:29
OpenCV2 + Pythonで背景を単色で埋める ref: http://qiita.com/daxanya1/items/85f5e17ecc1203f756ad
# coding: UTF-8
import numpy as np
import cv2
# 10 x 10 の3レイヤー(BGR)を定義
size = 10, 10, 3
# cv2.fillPolyで赤に埋める
red_img = np.zeros(size, dtype=np.uint8)
@daxanya2
daxanya2 / example2-3.py
Created June 22, 2014 05:59
OS X に OpenCV を Homebrew で入れて python で動画入出力をする ref: http://qiita.com/daxanya1/items/4709ad8454760e17148c
# coding: UTF-8
import numpy as np
import cv2
# 実装の参考 http://www.beechtreetech.com/opencv-exercises-in-python
# cv2を使うように変更
updatelock = False # トラックバー処理中のロックフラグ
windowname = 'frame' # Windowの名前
trackbarname = 'Position' # トラックバーの名前
@daxanya2
daxanya2 / arrownode.html
Created March 1, 2014 12:37
d3.jsで、①→②を衛星軌道っぽく回してみる ref: http://qiita.com/daxanya1/items/0c2d6885546a381aa6e9
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="d3.v3.min.js"></script>
</head>
<body>
<div id='example'></div>
<script src="arrownode_move.js"></script>
</body>
</html>
@daxanya2
daxanya2 / arrownode.html
Created February 26, 2014 14:08
d3.js超初心者向け ①→②を表現してみる ref: http://qiita.com/daxanya1/items/734e65a7ca58bbe2a98c
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="d3.v3.min.js"></script>
</head>
<body>
<div id='example'></div>
<script src="arrownode.js"></script>
</body>
</html>
@daxanya2
daxanya2 / example.json
Created February 8, 2014 15:21
jqのバージョンを最新にしたらjsonの処理が捗りすぎて怖い ref: http://qiita.com/daxanya1/items/6ed6b292a838ed750d35
{"messages":[{"date":"2014-02-06T10:01:07+0900","from":{"name":"daxanya (-v-)","user_id":544xxx},"message":"https:\/\/github.com\/bowery\/orcheTstrate.js"},{"date":"2014-02-06T10:01:11+0900","from":{"name":"daxanya (-v-)","user_id":544xxx},"message":"orchestrate.js"},{"date":"2014-02-06T10:01:18+0900","from":{"name":"daxanya (-v-)","user_id":544xxx},"message":"http:\/\/www.slideshare.net\/who_you_me\/neo4j-24294061"},{"date":"2014-02-06T10:01:22+0900","from":{"name":"daxanya (-v-)","user_id":544xxx},"message":"\u30b0\u30e9\u30d5\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u300cNeo4j\u300d\u306e \u5c0e\u5165\u306e\u5c0e\u5165"}]}
@daxanya2
daxanya2 / file0.txt
Created February 8, 2014 05:00
Hipchatに入力した内容をAPIで取得してDay Oneにワンライナーで貼付ける ref: http://qiita.com/daxanya1/items/da15ce1853465e262ba8
https://api.hipchat.com/v1/rooms/history?room_id={room_id}&date={date}&timezone=JST&format=json&auth_token={token}