Skip to content

Instantly share code, notes, and snippets.

@yokotak0527
yokotak0527 / gist:5924800
Created July 4, 2013 03:52
JSで気になる書き方
var obj = {};
(obj.Func = function(){}).prototype = {};
import js.Lib;
class Main{
static function main(){
js.Lib.alert('hoge');
}
}
/*
var shadow_cvs,shadow_ctx,box_blur,bounds;
shadow_cvs = document.createElement('canvas');
shadow_ctx = shadow_cvs.getContext('2d');
this.body.draw(shadow_ctx,true);
this.shadow_body = new cjs.Bitmap(shadow_cvs);
this.shadow_body.set({
x:7,
y:5,
scaleX:1.1,
@yokotak0527
yokotak0527 / gist:6157009
Created August 5, 2013 15:52
TypeScript 関数の書き方メモ
// function 文の型注訳
function func0(str:string):string{
return str;
}
// ------------------------------------------------
// function 式の型注訳
var func1:(str:string) => string = function(str){
return str;
@yokotak0527
yokotak0527 / gist:6274466
Last active December 21, 2015 07:58
射影変換 ( ホモグラフィ )
     bx + by + c
u = -------------
     gx + yh + 1

     dx + ey + f
v = -------------
     gx + hy + 1

平面射影変換

@yokotak0527
yokotak0527 / gist:7020366
Last active December 25, 2015 18:29
ベンダープレフィックスを付ける即席のあれ。
@mixin keyframes($name){
@-webkit-keyframes #{$name}{@content;}
@-moz-keyframes #{$name}{@content;}
@-ms-keyframes #{$name}{@content;}
@keyframes #{$name}{@content;}
}
@mixin apply-vendor($type,$val...){ @each $prefix in $vendors{
#{$prefix}#{$type} : $val; }
}
@yokotak0527
yokotak0527 / gist:7955970
Created December 14, 2013 05:25
jsdokusho typescript & three.js sample
/// <reference path="../d.ts/DefinitelyTyped/jquery/jquery.d.ts" />
/// <reference path="../d.ts/DefinitelyTyped/threejs/threejs.d.ts" />
class Sample{
camera : THREE.PerspectiveCamera;
scene : THREE.Scene;
renderer : THREE.CanvasRenderer;
geometry : THREE.CubeGeometry;
material : THREE.MeshBasicMaterial;
mesh : THREE.Mesh;
class Path{
private static function encode_special_text($path){
$path = str_replace(':/','{{ptcl_sep}}',$path);
return $path;
}
private static function decode_special_text($path){
$path = str_replace('{{ptcl_sep}}',':/',$path);
return $path;
}
// =========================================================================
@yokotak0527
yokotak0527 / js
Created February 14, 2016 14:15
簡易イベント管理
!function(app){
let instance = null;
let listener = {};
let callback = {};
let nonameListener = 'event';
let nonameListenerNum = 0;
class Event{
constructor(){
- Backtraking
- Knight's tour problem
- N Queens Problem
- Cryptography
- Affine Cipher
- Caesar Cipher
- Dynamic Programming
- Catalan Number
- Fibonacci Sequence
- Integer Partition