Skip to content

Instantly share code, notes, and snippets.

View tai2's full-sized avatar
🐢

Taiju Muto tai2

🐢
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <GLUT/glut.h>
#define KEY_ESC 27
#define WINDOW_POS_X 100
#define WINDOW_POS_Y 100
#define DEF_SCREEN_WIDTH 640
@tai2
tai2 / noise_test.pde
Created May 15, 2013 11:34
Perlin noise test
float noise_step = 0.01;
float noise_velocity = 0.0001;
float noise_accel = 0.0001;
void setup() {
size(500, 500);
}
void keyPressed() {
@tai2
tai2 / pastell_circle.pde
Last active December 17, 2015 08:59
nothing to say
int quad_width = 25;
int rd = 10;
int[] colors = new int[180 / rd];
int color_idx = 0;
void setup() {
size(300, 300);
frameRate(24);
stroke(0, 100);
colorMode(HSB);
@tai2
tai2 / polor_noise.pde
Last active December 17, 2015 08:59
polar noise
float dnoise = 0;
void setup() {
size(300, 300);
frameRate(30);
}
void draw() {
background(0);
@tai2
tai2 / swiggling_hole.pde
Last active December 17, 2015 08:59
Swiggling hole
float dnoise = 0;
void setup() {
size(300, 300);
smooth();
frameRate(30);
}
void draw() {
background(0);
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <GLUT/glut.h>
#define KEY_ESC 27
#define WINDOW_POS_X 100
#define WINDOW_POS_Y 100
@tai2
tai2 / hello.m
Created August 13, 2013 19:00
Hello world for Objective-C
#import <Foundation/Foundation.h>
@interface HelloWorld : NSObject
- (void) hello;
@end
@implementation HelloWorld
- (void) hello {
NSLog(@"hello world!");
}
@tai2
tai2 / SerializeTest.java
Created September 11, 2013 08:14
Java Object serialization/deserialization
import java.io.*;
import java.util.*;
public class SerializeTest
{
private static void serialize()
{
Map<String, List<String>> headers = new HashMap<String, List<String>>();
@tai2
tai2 / pre-commit.sh
Created October 28, 2013 15:23
replace CR -> LF in files to be commited
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
for file in `git status --porcelain | grep '^[AM] ' | sed 's/^...//'`
do
ext=${file##*.}
if [ $ext = "as" ]; then
cat $file | tr '\r' '\n' > $file".tmp"
@tai2
tai2 / canvastest.html
Last active January 2, 2016 04:39
Canvas Test
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF=8">
<title>My First Canvas Application</title>
<script type="text/javascript">
window.addEventListener(
"load",
function(event) {
function canvasSupport() {