Skip to content

Instantly share code, notes, and snippets.

View AxGord's full-sized avatar
🦄
Pony

Alexander Gordeyko AxGord

🦄
Pony
View GitHub Profile
@AxGord
AxGord / gist:5730835
Last active December 18, 2015 05:09
HScript live coding. Using in https://github.com/AxGord/LiveTeacher
package ;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.Lib;
import flash.text.TextField;
import flash.text.TextFieldType;
import flash.events.Event;
/**
static var keyWords = ['for', 'while', 'if', 'else', 'do', 'class', 'case', 'cast', 'catch', 'continue', 'enum', 'super', 'switch', 'true',
'package', 'in', 'import', 'static', 'function', 'null', 'extends', 'extern', 'false', 'implements', 'inline', 'this', 'throw', 'trace',
'break', 'callback', 'default', 'dynamic', 'interface', 'never', 'new', 'override', 'private', 'public', 'return', 'static',
'try', 'typedef', 'untyped', 'using', 'var'];
static var vSymb = '_abcdefghijklmnopqrstuvwxyz';
static function checkIsValidFieldName(v:String):Bool {
if ( v == '' || Std.parseInt(v.substr(0, 1)) != null) return false;
v = v.toLowerCase();
if ( Lambda.indexOf(keyWords, v) != -1 ) return false;
for (i in 0...v.length) if (vSymb.indexOf(v.substr(i, 1)) == -1 && Std.parseInt(v.substr(i, 1)) == null) return false;
@AxGord
AxGord / Reference.hx
Last active December 19, 2015 01:09
Build simple help System for your apps.
package ;
import com.bit101.components.TextArea;
import com.bit101.components.List;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.filters.BlurFilter;
import flash.filters.GlowFilter;
import flash.geom.Rectangle;
import flash.net.URLLoader;
package ;
import com.dongxiguo.protobuf.binaryFormat.LimitableBytesInput;
import haxe.io.BytesInput;
import haxe.io.BytesOutput;
import pony.net.SocketClient;
import pony.net.SocketServer;
import samplePackage.Call_Builder;
import samplePackage.SetSpeed_Builder;
package ;
import bindx.IBindable;
import unityengine.MonoBehaviour;
using bindx.Bind;
/**
* Test
* @author AxG
*/
class Test extends MonoBehaviour implements IBindable
{
@AxGord
AxGord / Elvis.hx
Last active December 24, 2015 09:19
package ;
import haxe.macro.Context;
import haxe.macro.Expr;
import neko.Lib;
/**
* ...
* @author AxGord <axgord@gmail.com>
*/
package ;
import neko.Lib;
using Main;
/**
* ...
* @author AxGord <axgord@gmail.com>
*/
class Main {
@AxGord
AxGord / config.xml
Last active December 30, 2015 22:09
CircleTimer config example
<?xml version="1.0" encoding="utf-8"?>
<config invertbar="true" mouseFilterWait="1000" mouseFilterCount="9">
<work repeat="5000" sound="start.mp3">1</work>
<relax sound="start.mp3">1</relax>
<idle>10</idle>
</config>
@AxGord
AxGord / Com.hx
Created March 11, 2014 15:39
TCP-IP <-> Com port bridge
package ;
import haxe.io.BytesInput;
import haxe.io.BytesOutput;
import pony.net.SocketClient;
import pony.net.SocketServer;
import pony.nodejs.SerialPort;
using pony.Tools;
@AxGord
AxGord / FastSignalsExample.hx
Created April 2, 2014 06:47
Ultra fast and small strict typed simple signals.
package ;
class FastSignalsExample {
static function main() {
var o = new Signal1<String>();
o.add(function(v) trace(v));
o.dispatch('Hello');
}
}