Skip to content

Instantly share code, notes, and snippets.

View fishkingsin's full-sized avatar
✈️

James Kong fishkingsin

✈️
View GitHub Profile
@fishkingsin
fishkingsin / testApp.cpp
Created April 29, 2013 04:20
vbo mix ofxDelaunay
#include "testApp.h"
#pragma once
#include "ofMain.h"
#define NUM_STRIP 100
#define LENGTH 40
#define LOC_LENGTH 20
#include "ofxDelaunay.h"
class testApp : public ofBaseApp{
@fishkingsin
fishkingsin / testApp.mm
Created April 29, 2013 04:50
ios bonjour client
#pragma once
#include "ofMain.h"
#include "ofxiPhone.h"
#include "ofxiPhoneExtras.h"
#include "ofxBonjour.h"
using namespace ofxBonjour;
class testApp : public ofxiPhoneApp{
#include "testApp.h"
void addFace(vector<ofVec3f> &pos,vector<ofFloatColor> &color,vector<ofVec3f> &normal, vector<ofVec2f>&texcoord, ofVec3f a, ofVec3f b, ofVec3f c) {
ofVec3f _normal = ((b - a).cross(c - a)).normalize();
ofFloatColor _color = ofFloatColor::fromHsb(ofRandom(0.5,0.9),1.0,1.0);
pos.push_back(a);
pos.push_back(b);
pos.push_back(c);
color.push_back(_color);
#include "testApp.h"
#define foreach(t,v) for(typeof(v.begin()) p=v.begin(); p!=v.end(); p++) { typeof(*p) &t=*p;
#define endfor }
class Vertex : public ofVec3f {
public:
Vertex(float x, float y) : ofVec3f(x,y) {}
Vertex(ofVec3f v) { set(v); }
ofFloatColor color;
ofVec3f normal;
@fishkingsin
fishkingsin / rename_space.sh
Created July 8, 2013 13:16
replace space to dsah
#!/bin/bash
ls | while read -r FILE
do
mv -v "$FILE" `echo $FILE | tr ' ' '_' `
done
@fishkingsin
fishkingsin / covert_files.sh
Created July 8, 2013 13:17
cover m4 a rename sequencial file number create thumbnail cover image
#!/bin/bash
for folder in $(ls ./20130629_Songs/)
do
# echo ./20130629_Songs/$folder
cd ./20130629_Songs/$folder
../../rename_space.sh
for i in $(ls *.m4a)
do
j=`echo $i | tr 'm4a' 'mp3' `
@fishkingsin
fishkingsin / gen_your_name.sh
Last active December 21, 2015 02:49
identicon usage script
curl -O https://raw.github.com/aurora/identicon/master/identicon.sh && bash identicon.sh -H $(echo -n "your_name" | md5) -o icon.png -s 512
@fishkingsin
fishkingsin / install_spree.sh
Created August 15, 2013 02:08
prepare spree online store
sudo gem install rails -v 3.2.14
sudo gem install spree
rails _3.2.14_ new my_store
spree install my_store
@fishkingsin
fishkingsin / happy_birthday.sh
Created August 15, 2013 07:13
happy birthday
curl -O https://raw.github.com/aurora/identicon/master/identicon.sh && bash identicon.sh -H $(echo -n "Happy Birthday to Me" | md5) -o icon.png -s 512
@fishkingsin
fishkingsin / railsready.sh
Created August 15, 2013 07:21
script to setup ruby on rails on RPi
sudo apt-get install -y git curl zlib1g-dev subversion
sudo apt-get update
sudo apt-get install -y openssl libreadline6-dev git-core zlib1g libssl-dev
sudo apt-get install -y libyaml-dev libsqlite3-dev sqlite3
sudo apt-get install -y libxml2-dev libxslt-dev
sudo apt-get install -y autoconf automake libtool bison
curl -L get.rvm.io | bash -s stable --rails
source ~/.rvm/scripts/rvm
ruby -v
rails -v