Updated as of 08 March 2019
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright (c) 2013 Mikko Mononen memon@inside.org | |
// | |
// This software is provided 'as-is', without any express or implied | |
// warranty. In no event will the authors be held liable for any damages | |
// arising from the use of this software. | |
// Permission is granted to anyone to use this software for any purpose, | |
// including commercial applications, and to alter it and redistribute it | |
// freely, subject to the following restrictions: | |
// 1. The origin of this software must not be misrepresented; you must not |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To see this run, you first stub out these imports. Then put the file in a Uint8Array. | |
// let slice = new Slice(array); | |
// let font = new OTFFont(slice); | |
// Then you can call methods like font.drawText(canvasContext, ) | |
// | |
// | |
import { ICanvasContext } from "./ICanvasContext" | |
import { log as Log } from "./log" | |
const log = Log.create("OPENTYPE"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A worklet for recording in sync with AudioContext.currentTime. | |
More info about the API: | |
https://developers.google.com/web/updates/2017/12/audio-worklet | |
How to use: | |
1. Serve this file from your server (e.g. put it in the "public" folder) as is. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using WithMacro; | |
typedef Player = { | |
final name:String; | |
final level:Int; | |
} | |
class Main { | |
static function main() { | |
var player = {name: "Dan", level: 15}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require('crypto'); | |
var fs = require('fs'); | |
var exec = require('child_process').exec; | |
var uploadCommand = "firebase auth:import users.json --hash-algo=MD5 --rounds=0"; | |
var stringToBase64 = function(plaintext){ | |
return new Buffer(plaintext).toString('base64'); | |
} | |
var users = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.ds.Either; | |
class Main { | |
static function main() { | |
trace("HI"); | |
var t : WildMap = ["a" => 1, "b"=> 2]; | |
var f = function(x : Map<Int,String>){ | |
trace(x); | |
for (k in x.keys()){ | |
trace(k); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class KeyValueIterator<K,V> { | |
var map:Map<K,V>; | |
var keys:Iterator<K>; | |
static public inline function pairs<K,V>(map:Map<K,V>) return new KeyValueIterator(map); | |
public inline function new(map:Map<K,V>) { | |
this.map = map; | |
this.keys = map.keys(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@:structInit | |
class A { | |
var x:Int; | |
var y:Int; | |
} | |
@:structInit | |
class B { | |
var a:A; | |
var k:Int; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main { | |
static function main() { | |
Sdl.init(Sdl.INIT_EVERYTHING); | |
var win = Sdl.createWindow("Hello", 100, 100, 800, 600, Sdl.WINDOW_OPENGL); | |
var ren = Sdl.createRenderer(win, -1, Sdl.RENDERER_ACCELERATED); | |
var bmp = Sdl.loadBMP("test.bmp"); | |
var tex = Sdl.createTextureFromSurface(ren, bmp); | |
Sdl.freeSurface(bmp); | |
for (i in 0...3) { |
NewerOlder