Skip to content

Instantly share code, notes, and snippets.

View zigen's full-sized avatar
🏠
Working from home

Kentaro "zigen" Teramoto zigen

🏠
Working from home
View GitHub Profile
@zigen
zigen / update0214.log
Last active August 29, 2015 14:15
FirefoxOSの起動画面で止まっています。とりあえずdmesgしてみました
Terminal ready
shell@android:/ # dmesg
<6>[ 0.000000] Initializing cgroup subsys cpu
<5>[ 0.000000] Linux version 3.0.36+ (fun@fxos) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Sat Feb 14 14:02:58 JST 2015
<4>[ 0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
<4>[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
<4>[ 0.000000] Machine: RK30board
<4>[ 0.000000] Ignoring unrecognised tag 0x00000000
#include <stdio.h>
#include <stdlib.h>
struct Cell {
struct Cell *next;
int value;
} ;
struct Cell* head;
void free_all();
void setup() {
// put your setup code here, to run once:
pinMode(13,OUTPUT);
Serial.begin(9600);
}
int i=0;
float b = pow(2.0,0.833333);
float freq = 440.0;
int scale[7] = {0,2,3,5,7,8,10};
@zigen
zigen / gist:a11ac44d82846070e0c0
Created May 1, 2015 12:36
arduinoとシリアル通信
import processing.serial.*;
boolean isEmit = false;
Serial arduino;
void setup() {
println(Serial.list());
arduino = new Serial(this, Serial.list()[5], 9600);
arduino.write(0);
}
void draw() {
@zigen
zigen / game.rb
Created June 26, 2015 14:19
tic tac toe
class Tic
X = "x"
O = "o"
def initialize
puts "Initialized"
@board = [
"-","-","-",
"-","-","-",
"-","-","-",
]
@zigen
zigen / game.rb
Created June 26, 2015 16:28
Level2
class Tic
X = "x"
O = "o"
def initialize
puts "Initialized"
@board = [
"-","-","-",
"-","-","-",
"-","-","-",
@zigen
zigen / gist:a17c0ed953a8b2e9945b
Created June 29, 2015 09:35
arduino調光器GUI
import controlP5.*;
import processing.serial.*;
ControlP5 cp5;
Knob[] colorKnob = new Knob[3];
Serial arduino;
color ledColor;
int r=0, g=0, b=0;
void setup()
{
for i in 0.."Hello".length-1
print ("Hello"[i].ord + 1).chr
end
@zigen
zigen / encr.rb
Created September 15, 2015 11:23
def encrypt str, key
for i in 0..str.length-1
print (str[i].ord + key), " "
end
end
for i in 0..25
encrypt "Hello",i
print "\n"
end
buf = []
i=0
while nil != buf[i] = gets
buf[i] = buf[i].to_i
i += 1
end