Skip to content

Instantly share code, notes, and snippets.

View THREE.SpringCamera.js
/*
SpringCamera.js
*/
THREE.SpringCamera = function (_width, _height) {
/*
constructor
*/
var VIEW_ANGLE = 45, ASPECT = _width / _height, NEAR = 0.01, FAR = 10000000;
this.nextCamPosX = 0;
this.nextCamPosY = 0;
@moxuse
moxuse / gist:ab20e076a45fda8b1d59
Created Jun 13, 2014
gif animation shell script ffmpeg with gifsicle
View gist:ab20e076a45fda8b1d59
ffmpeg -i flow.mp4 -s 716x594 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
View gist:b906edfc9ec569e060c1
func urlEncodedStringWithEncoding(encoding: NSStringEncoding) -> String {
let charactersToBeEscaped = ":/?&=;+!#$()',*" as CFStringRef
let charactersToLeaveUnescaped = "[]." as CFStringRef
let result = CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, self.bridgeToObjectiveC(), charactersToLeaveUnescaped, charactersToBeEscaped, CFStringConvertNSStringEncodingToEncoding(encoding))
return NSString(format:result)
}
@moxuse
moxuse / shell
Created Sep 18, 2014
cupertino expect download
View shell
dc ${WORKSPACE}
/usr/bin/expect -c "
set timeout 5
spawn ios profiles:download --type <type of profile> \"<your profile name>\"
expect (Select a team:*)
send \"1\n\"
expect .*
send \"exit\"
"
@moxuse
moxuse / GameViewController.swift
Last active Aug 29, 2015
ScenKit Shader Handle Binding Test
View GameViewController.swift
import UIKit
import QuartzCore
import SceneKit
class GameViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let numSphere = 25
@moxuse
moxuse / sample.sc
Created Oct 11, 2014
of_seminar_hatiouzi_2014 SC OSCSend Sample
View sample.sc
s.boot;
(
SynthDef("click",{
Out.ar(0,ClipNoise.ar(0.02) * EnvGen.ar(Env.perc(0.0,0.05,1,-2), 1, doneAction: 2));
}).store
)
(
View radio-despatch-synth.sc
//set server to gs server.
s=Server("Tamabi gs server", NetAddr("122.212.35.122", 57110));
(
SynthDef("despatch_radio_synth", {
|amp = 1,
azimuth = 111.9,
declination = -23.3,
distance = 31931930,
elevation = 20.3,
@moxuse
moxuse / gist:77549fb5b79fbd43e94d
Last active Aug 29, 2015
Intel Edison IPカメラを認識させるためにリカバリーセットアップする
View gist:77549fb5b79fbd43e94d
// poky 3.10.17 > からはデフォルトでuvccamera moduleがサポートされたので、自分でopkg install uvccamera する必要がない。
// 下手にするとカーネルモジュールが壊れる。
// https://software.intel.com/en-us/iot/hardware/edison/downloads > Release 2.1 Yocto* complete image をダウンロード
cd xxxx/paedison-image-ww25
//フラッシュを初期化、の前に
//macだとdfu-waitが長すぎて失敗するのでスクリプトを一部修正する必要が有る -> https://gist.github.com/ddewaele/f1b13545586c78ddb545
./flashall.sh
@moxuse
moxuse / gist:73cff10f4cfcace10121
Last active Aug 29, 2015
ofTrueTypeFont to ofVbo Texture
View gist:73cff10f4cfcace10121
class SomeClass {
private:
string textString;
ofTrueTypeFont font;
ofTexture stringTexture;
ofVbo vbo;
ofMesh stringMesh;
ofVec3f verts[VERT_BUF_NUM];
View mounter_b_2015_08_06.stl
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.