Skip to content

Instantly share code, notes, and snippets.

View koji's full-sized avatar
🔍
I may be slow to respond.

koji koji

🔍
I may be slow to respond.
View GitHub Profile
@koji
koji / flocking3D
Created February 19, 2017 23:39 — forked from Craigson/flocking3D
nature of code example for flocking in 3D.
import peasy.*;
Flock flock;
int boundary = 500;
PeasyCam cam;
// GUI
import controlP5.*;
PImage img;
float m,t;
void setup() {
size(500, 500);
noFill();
stroke(255);
strokeWeight(2);
m=0.0;
t=0.0;
function setup() {
createCanvas(720,480);
strokeWeight(2);
ellipseMode(RADIUS);
}
function draw() {
background(204);
// neck
@koji
koji / analog.ino
Last active September 27, 2016 00:59
Arduino and Processing
int rgbR = A0;
int rgbG = A1;
int rgbB = A2;
int axisX = A3;
int axisY = A4;
int sType = A5;
// for color
int mapR=0;
int mapG=0;
int loop_cnt =0;
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
}
@koji
koji / arduino.pde
Last active September 26, 2016 23:16
for arduino
import processing.serial.*;
Serial myPort;
String input;
int r = 0;
int g = 0;
int b = 0;
@koji
koji / sketch.ino
Created September 26, 2016 21:40
For Arduino
int rgbR = A0;
int rgbG = A1;
int rgbB = A2;
int mapR=0;
int mapG=0;
int mapB=0;
int r=0;
int g=0;
int b=0;
void setup() {
$ git init #Initialize git repo
$ git add -A # Add everything
$ git commit -m "comment"
$ git commit # when hit this command, vi will be started to add comment to commit. Write something and save it.
$ git show = git show HEAD
@koji
koji / .pryrc
Created July 12, 2016 20:23
alias for pryrc debug
if defined?(PryByebug)
Pry.commands.alias_command 'c', 'continue'
Pry.commands.alias_command 's', 'step'
Pry.commands.alias_command 'n', 'next'
Pry.commands.alias_command 'f', 'finish'
end
@koji
koji / quickreplies.js
Last active July 10, 2016 20:30
Facebook Quick Replies
function sendQuickReplies(sender) {
messageData = {
"text": "Hey!!!:",
"quick_replies": [
{
"content_type": "text",
"title": "yoyo",
"payload": "yoyo"
},
{