Skip to content

Instantly share code, notes, and snippets.

@moxuse
moxuse / YAHooAPIKeyphraseService
Created October 23, 2013 07:49
YAHoo API KeyphraseService
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import optparse
import httplib
from lxml import etree
# Yahoo!API config
appId = 'APPLICATION ID'
session = httplib.HTTPConnection('jlp.yahooapis.jp')
@moxuse
moxuse / THREE.SpringCamera.js
Created June 3, 2014 09:55
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 June 13, 2014 04:51
gif animation shell script ffmpeg with gifsicle
ffmpeg -i flow.mp4 -s 716x594 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
@moxuse
moxuse / gist:b906edfc9ec569e060c1
Last active August 29, 2015 14:04
extension String
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 / GameViewController.swift
Last active February 13, 2022 21:24
SCNShadable Shader Modifiers Test
import SceneKit
import QuartzCore
class GameViewController: NSViewController {
@IBOutlet weak var gameView: GameView!
override func awakeFromNib(){
let numSphere = 10
@moxuse
moxuse / shell
Created September 18, 2014 06:07
cupertino expect download
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 August 29, 2015 14:06
ScenKit Shader Handle Binding Test
import UIKit
import QuartzCore
import SceneKit
class GameViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let numSphere = 25
@moxuse
moxuse / sample.sc
Created October 11, 2014 11:50
of_seminar_hatiouzi_2014 SC OSCSend Sample
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
)
(
@moxuse
moxuse / GameViewController.swift
Created October 23, 2014 10:39
SceneKit Physics Test
import SceneKit
import QuartzCore
class GameViewController: NSViewController {
@IBOutlet weak var gameView: GameView!
override func awakeFromNib(){
let numBox = 300
//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,