Skip to content

Instantly share code, notes, and snippets.

@clemos
clemos / Dockerfile
Last active August 29, 2015 14:10 — forked from ybootin/Dockerfile
Docker file for Haxe2
FROM ubuntu:latest
MAINTAINER Yohan Boutin <yohan.boutin@teads.tv>
RUN apt-get update
RUN apt-get -y upgrade
ENV HAXE_LIBRARY_PATH /usr/bin/haxelib
ENV HAXEPATH /usr/bin/haxe
import js.npm.mongoose.Model;
import js.npm.mongoose.Schema;
import js.npm.Mongoose;
class TestMongoose {
public static function main(){
Mongoose._.connect( 'mongodb://localhost/test' , cast start );
}
@clemos
clemos / HybridSwitch.hx
Last active December 16, 2015 13:39
Make haxe switch to accept both patterns and identifiers
import haxe.macro.Context;
import haxe.macro.Expr;
class HybridSwitch {
/*
this macro attempts to make switch / case work both
with the new pattern matching feature and with
simple switch variables
@clemos
clemos / MyWorkerScript.hx
Created November 16, 2012 10:19
Javascript Workers in Haxe
using WorkerScript;
class MyWorkerScript extends WorkerScript {
public override function onMessage(e){
trace("on message triggered");
postMessage("ola");
}
static function main(){
@clemos
clemos / .htaccess
Created March 4, 2012 15:56
server side haXe auto-compilation scripts
RewriteEngine on
RewriteRule ^(.*)\.hx\.js compilejs.php?cl=$1 [QSA]
@clemos
clemos / bookmarklet.html
Created October 6, 2011 10:13
Embedr - a bookmarklet script to steal embeds from other sites
<a href="javascript:s=document.createElement('SCRIPT');s.type='text/javascript';s.src='https://raw.github.com/gist/1267050/c20d7312e80a152508fb04a91f09fae8248b138c/embedr.js?'+Math.random();document.getElementsByTagName('head')[0].appendChild(s);">Embedr</a>
<ul>
<li>Grab the link to your bookmarks bar up there</li>
<li>Click on 'Embedr' bookmark when you are on a page you want to get embeds from</li>
</ul>