Skip to content

Instantly share code, notes, and snippets.

Philippe elsassph

Block or report user

Report or block elsassph

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
elsassph / minify-all.js
Created Mar 16, 2018
Run uglify-js on all the javascript files in a folder
View minify-all.js
// NOTE: run with `NODE_ENV=production` for optimal results
const fs = require('fs');
const path = require('path');
const UglifyJS = require('uglify-js');
// Path to process
const bin = './bin';
function onlyJS(files) {
elsassph /
Last active Aug 30, 2016
Nginx single-page app local dev server config

Easy single-page app dev using nginx

If you're using only nginx (no Apache thx) and want to serve your projects using a local dev domain.

Install nginx

brew install nginx

Or download/unzip for Win:

elsassph / ResourceGenerator.hx
Created Jul 3, 2016
Haxe build macro converting a JSON file into strongly typed, inline/dce friendly, properties
View ResourceGenerator.hx
#if macro
import haxe.Json;
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Type;
import sys.FileSystem;
elsassph / 0_Test.hx
Last active Nov 26, 2017
Haxe macro for: custom, automatic, getter/setter generation
View 0_Test.hx
We want to generate:
- getMyProperty / setMyProperty
- getAnotherProperty
- getYetAnotherProperty / setYetAnotherProperty
class Test implements Proxied
public var MyPoperty(default, default):Int;
elsassph / 0-Example.hx
Last active May 25, 2016
Haxe - use macro to generate dispatch code
View 0-Example.hx
Automatically generate dispatch functions as:
public function onDoubleArguments(one:String, two:Int) {
for (listener in listeners)
listener.onDoubleArguments(one, two);
class Example extends Dispatcher<Dynamic>
elsassph / 1-loop-es6.js
Last active Dec 5, 2016
ES2015 / babel vs Haxe code generation
View 1-loop-es6.js
const a = [1,2,3];
var acc = 0;
for (const v of a) {
acc += v;
// want clean code? use Array.reduce
View poop.js
Array.prototype.poop = function() {
// return nothing, it's poop
Array.prototype.shit = function() {
// return nothing, it's poop
elsassph / Module1.hx
Last active Dec 29, 2015
One approach to building Haxe JS modules - EDIT: see
View Module1.hx
package modules;
class Module1
static public function main()
trace("Module1 is loaded");
var m1 = new Module1();
elsassph / index.php
Last active Aug 29, 2015
Create a VoiceChatAPI room from Slack
View index.php
// first create a new voice chat room:
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query(array()),
elsassph /
Created Sep 6, 2012
Sample Away3D Lite Stage3DRenderer
import away3dlite.containers.View3D;
import away3dlite.core.render.Renderer;
import away3dlite.core.render.Stage3DRenderer;
import away3dlite.materials.BitmapMaterial;
import away3dlite.primitives.Plane;
import away3dlite.primitives.Skybox6;
import flash.display.Shape;
You can’t perform that action at this time.