Skip to content

Instantly share code, notes, and snippets.

View Tomyail's full-sized avatar
🎯
Focusing

Leo sun Tomyail

🎯
Focusing
View GitHub Profile
@Tomyail
Tomyail / Matrix3DTest.as
Created December 1, 2011 03:42
以可视化的方式表现矩阵变幻
package
{
import com.bit101.components.InputText;
import com.bit101.components.PushButton;
import flash.display.Shape;
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.MouseEvent;
import flash.geom.Matrix3D;
@Tomyail
Tomyail / FishRoundFly.as
Created December 9, 2011 10:06
坐标旋转版圆周运动(包含坐标误差版本和正确版本)
package demo
{
import flash.display.Sprite;
import flash.events.*;
import flash.geom.Matrix;
import flash.geom.Point;
public class FishRoundFly extends Sprite
{
private var fish:Sprite = new Sprite;
@Tomyail
Tomyail / Clock.as
Created March 20, 2012 09:12
"万能"计时器
package
{
import flash.events.TimerEvent;
import flash.utils.Timer;
/**
* 计时器
* @author lixuexin
*
*/
public class Clock
package utils
{
import flash.system.System;
import flash.utils.describeType;
public class FunctionUtils
{
/**
* 不适合构造函数
* @param target
@Tomyail
Tomyail / getLegalIndexFromArray.as
Created January 10, 2013 12:32
(i%3+3)%3 i是任意整型,3是数组长度,得到的结果都是一个对于该数组合法的索引
public function getLegalIndexFromArray(index,arrayLength):int
{
return (index%arrayLength+arrayLength)%arrayLength;
}
package
{
import com.greensock.TweenLite;
import com.greensock.easing.Quad;
import com.greensock.easing.Quart;
import com.greensock.easing.Quint;
import flash.display.Sprite;
import flash.events.MouseEvent;
public class CircularCoverFlow extends Sprite
@Tomyail
Tomyail / GamblingCircle.as
Created July 11, 2013 08:26
幸运转盘
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Point;
import flash.utils.getTimer;
class GamblingCircle
{
private var path:Vector.<Point>;
private var items:Vector.<DisplayObject>;
@Tomyail
Tomyail / curry test.js
Created June 6, 2017 01:55
curry test created by Tomyail - https://repl.it/I7cW/0
var R = require('ramda');
var add = (b,str)=>str.split(b);
const curryAdd = R.curry(add);
curryAdd(" ")("2 1")
@Tomyail
Tomyail / redmine2omnifocus.js
Last active August 1, 2017 07:51
get the selected title and href from redmine and add them to omnifucus
/**
* Created by lixuexin on 2017/8/1.
*/
// how to use
// 1: selected the items you want to add to omnifocus ( press command for multi select )
// 2: open chrome(>59) console and paste the follow code
var count = 0;
Array.prototype.forEach.call(
document.getElementsByClassName('context-menu-selection'),
item => {
@Tomyail
Tomyail / dynamic-add-reducer-in-redux.js
Created September 15, 2017 08:14
dynamic add reducer in redux
/**
* Created by lixuexin on 2017/9/15.
*/
import { createStore, combineReducers } from 'redux';
import _ from 'lodash';
const reducer = combineReducers({
dynamicRoot: (state = {}, action) => {
// if your want to change all reducer,see