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
; Binheap priority queue | |
; Based on 6502 code by MagerValp | |
; https://github.com/MagerValp/AsmHeap | |
; 255 items max, 3 bytes wasted | |
struct HEAPQ | |
align 256 | |
tree ds 255, 0 | |
size db 0 |
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
#!/usr/bin/env haxex -lib mcli @ | |
/** | |
Taken from mcli example https://github.com/waneck/mcli | |
Say hello. | |
Example inspired by ruby's "executable" lib example | |
**/ | |
class HaxeScript extends mcli.CommandLine | |
{ | |
/** |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#ifdef _MSC_VER | |
#include <intrin.h> /* for rdtscp and clflush */ | |
#pragma optimize("gt",on) | |
#else | |
#include <x86intrin.h> /* for rdtscp and clflush */ | |
#endif |
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
public class AlertDialogHelper { | |
private static void displayAlertDialog(Context context, String title, String body, DialogAction... actions) { | |
LayoutInflater inflater = LayoutInflater.from(context); | |
final LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, 1); | |
final View inflatedLayout = inflater.inflate(R.layout.custom_alert_dialog, null); | |
final AlertDialog dialog = new AlertDialog.Builder(context).create(); | |
dialog.setView(inflatedLayout); | |
((TextView)inflatedLayout.findViewById(R.id.title)).setText(title); | |
((TextView)inflatedLayout.findViewById(R.id.body)).setText(body); |
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
@:cppInclude('time.h') | |
class CPPRandomSeed { | |
public static function seed() { | |
#if cpp | |
untyped __cpp__('srand(time(NULL))'); | |
#end | |
} | |
} |
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.macro.Context; | |
import haxe.macro.Expr; | |
import haxe.macro.TypeTools; | |
#if !macro | |
@:genericBuild(PartialMacro.build()) | |
#end | |
class Partial<T> {} | |
class PartialMacro { |
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
android.permission.ACCESS_ALL_DOWNLOADS | |
android.permission.ACCESS_BLUETOOTH_SHARE | |
android.permission.ACCESS_CACHE_FILESYSTEM | |
android.permission.ACCESS_CHECKIN_PROPERTIES | |
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY | |
android.permission.ACCESS_DOWNLOAD_MANAGER | |
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED | |
android.permission.ACCESS_DRM_CERTIFICATES | |
android.permission.ACCESS_EPHEMERAL_APPS | |
android.permission.ACCESS_FM_RADIO |
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 Getter<T> { | |
var name:String; | |
var obj:T; | |
public inline function new(name:String,obj:T) { | |
this.name = name; | |
this.obj = obj; | |
} | |
public inline function get() return untyped (obj:haxe.DynamicAccess<Dynamic>)[name]; |
NewerOlder