Skip to content

Instantly share code, notes, and snippets.

View kidapu's full-sized avatar
:octocat:
On vacation

kidapu kidapu

:octocat:
On vacation
  • 22:37 (UTC +09:00)
View GitHub Profile
@kidapu
kidapu / konashi-analog-read.js
Last active August 29, 2015 14:20
nobleでkonashi(koshian)のanalog readの値を読む
// 参考:http://konashi.ux-xu.com/documents/
var noble = require('noble');
var co = require('co');
noble.on('stateChange', function(state)
{
console.log( "state change:", state );
@kidapu
kidapu / chusen.html
Created September 17, 2015 07:50
抽選用スクリプト
<!DOCTYPE html>
<html>
<title>アンケート抽選用</title>
<body>
<script type="text/javascript">
var names = [
"Aさん",
"Bさん",
@kidapu
kidapu / timemeasure.h
Last active October 4, 2015 06:10
C++ time measure
clock_t clockStart, clockEnd;
clockStart = clock();
// ... 処理 ...
clockEnd = clock();
cout << "duration = " << (double)(clockEnd - clockStart) / CLOCKS_PER_SEC << "sec.\n";
@kidapu
kidapu / gifmaker.js
Last active October 29, 2015 06:14
動画からGIFアニ作る用Node.js
// fffmpegが必要
// さんこう:http://takuya-1st.hatenablog.jp/entry/2015/07/15/002701
// require
var _exec = require('child_process').execSync;
// static const
var _moviePath = "./src/test.mp4";
var _outPath ="./dest/out.gif"
var _rate = 0.5;
@kidapu
kidapu / ハードディスクが調子悪いとき.md
Created November 5, 2015 00:27
ハードディスクが調子悪いとき
  • マックのアプリで「ディスクユーティリティ」を起動

  • 検証&修復を繰り返す

@kidapu
kidapu / ochiru1.txt
Last active January 8, 2016 11:58
C++Study.txt
map<int,int> aa;
aa[0] = 0;
aa[1] = 0;
aa[2] = 2;
for( auto bb : aa )
{
cout << bb.first << ":" << bb.second << endl;
aa.erase(bb.first);
@kidapu
kidapu / ofTexture->ofImage.cpp
Last active January 25, 2016 10:53
openframworks_hamatta.txt
// ofTexureからofImageの変換
ofTexture tex = xxx.getTextureReference();
ofPixels p;
tex.readToPixels(p);
ofImage img;
//img.setFromPixels(p, tex.getWidth(), tex.getHeight(), OF_IMAGE_COLOR_ALPHA);
img.setFromPixels(p);
@kidapu
kidapu / glitching-octcat.h
Last active January 23, 2016 11:51
てきとーな画像グリッジ
// https://www.instagram.com/p/BA4WOQ2MtnT/
#pragma once
#include "ofMain.h"
class ofApp : public ofBaseApp
{
public:
@kidapu
kidapu / main.moon
Last active February 9, 2016 18:26
the way to require class in moonscript (this syntax is depreciated)
require "test"
a = test.AClass()
a\update()
a\update()
a\print()
@kidapu
kidapu / main.moon
Last active February 9, 2016 18:28
the way to require class in moonscript. http://www.luafaq.org/#T8.1.5
test = require "test"
t = test.TestClass()
t\update()
t\print()
print t.val