Skip to content

Instantly share code, notes, and snippets.

View boozook's full-sized avatar
👨‍💻
Dreaming about decentralized Gh, based on Pijul. 👨🏻‍💻

Alex boozook

👨‍💻
Dreaming about decentralized Gh, based on Pijul. 👨🏻‍💻
View GitHub Profile
@boozook
boozook / Main.hx
Last active November 17, 2015 19:59 — forked from nadako/Main.hx
Signal builder using new Rest type parameter in Haxe
package hx.event.test;
import haxe.unit.TestRunner;
class Main
{
public static function main()
{
var runner = new TestRunner();
runner.add(new SignalTest());
@tinybike
tinybike / geth-ipc.c
Created September 25, 2015 23:34
geth ipc connection
/**
* geth ipc connection
* @author Jack Peterson ([email protected])
*/
#include <stdio.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <string.h>
@boozook
boozook / Direction.hx
Last active June 8, 2016 14:35 — forked from MSGhero/Direction.hx
Compass direction <=> degree measure abstract for Haxe. Useful for me, maybe for you.
package entities;
import nape.geom.Vec2;
/**
* @author MSGHero
*/
@:enum
abstract Direction(Int) {
@MSGhero
MSGhero / Direction.hx
Last active September 25, 2015 09:03
Compass direction <=> degree measure abstract for Haxe. Useful for me, maybe for you.
package entities;
import nape.geom.Vec2;
/**
* @author MSGHero
*/
@:enum
abstract Direction(Int) {
@boozook
boozook / ResourceManager.hx
Last active August 26, 2015 19:26 — forked from tiagolr/ResourceManager.hx
Embeding files load with Haxe + Openfl
import haxe.io.Bytes;
import haxe.Resource;
import openfl.Assets;
import openfl.display.Bitmap;
import openfl.display.BitmapData;
import openfl.display.Loader;
import openfl.utils.ByteArray;
/**
@omz
omz / touchid.py
Last active November 15, 2023 23:35 — forked from alessaba/TouchID.py
TouchID.py
# coding: utf-8
from objc_util import *
import threading
NSBundle = ObjCClass('NSBundle')
LocalAuthentication = NSBundle.bundleWithPath_('/System/Library/Frameworks/LocalAuthentication.framework')
LocalAuthentication.load()
LAContext = ObjCClass('LAContext')
# authenticate() will raise one of these exceptions when authentication
@boozook
boozook / TestCase.hx
Created July 19, 2015 17:21
haxe.unit.TestCase with Enum-matching
/*
* Copyright (C)2005-2012 Haxe Foundation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
@nadako
nadako / Main.hx
Created June 24, 2015 19:36
Haxe + SDL = native love \o/
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) {
@nadako
nadako / Choice.hx
Created April 23, 2015 12:26
Poor man's enum
#if macro
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Type;
using haxe.macro.Tools;
#end
abstract Choice<T>(T) from T {
public macro function match(self, match) {
switch (match.expr) {
{
// The plugin looks for a .jsbeautifyrc file in the same directory as the
// source file you're prettifying (or any directory above if it doesn't exist,
// or in your home folder if everything else fails) and uses those options
// along the default ones.
// Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options
// Documentation: https://github.com/einars/js-beautify/
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg"],