Skip to content

Instantly share code, notes, and snippets.

View hamaluik's full-sized avatar
👋
I may be slow to respond.

Kenton Hamaluik hamaluik

👋
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env python
print '+----------------------------------------+'
print '| GradeMe-Watchman Bot by /u/FuzzyWuzzie |'
print '+----------------------------------------+'
import praw
from pprint import pprint
from datetime import datetime
import sys
import time
import math
@hamaluik
hamaluik / markdown_thirdparty.py
Created September 25, 2014 23:58
A Pelican plugin to enable third party Markdown extensions
# -*- coding: utf-8 -*-
"""
Markdown Third Party
============================
This plugin allows you to use various third-party
Markdown extensions to make writing posts in Markdown
easier and better.
"""
@hamaluik
hamaluik / AABB.hx
Last active March 14, 2024 16:57
Minkowski Difference Collision Detection
package ;
import openfl.display.Sprite;
/**
* ...
* @author Kenton Hamaluik
*/
class AABB
{
public var center:Vector = new Vector();
@hamaluik
hamaluik / AABB.hx
Created October 6, 2014 05:38
Continuous collision detection between two moving AABBs using Minkowski differences.
package ;
import openfl.display.Sprite;
/**
* ...
* @author Kenton Hamaluik
*/
class AABB
{
public var center:Vector = new Vector();
@hamaluik
hamaluik / ThreadPool.hx
Last active December 19, 2023 09:59
Platform-agnostic thread pool for Haxe / OpenFL
package com.blazingmammothgames.util;
#if neko
import neko.vm.Thread;
import neko.vm.Mutex;
#elseif cpp
import cpp.vm.Thread;
import cpp.vm.Mutex;
#end
@hamaluik
hamaluik / adxl345_spi.c
Created March 6, 2015 15:53
How to use the ADXL345 accelerometer with a Teensy (through SPI).
//Add the SPI library so we can communicate with the ADXL345 sensor
#include <SPI.h>
//Assign the Chip Select signal to pin 10.
int CS=10;
//ADXL345 Register Addresses
#define DEVID 0x00 //Device ID Register
#define THRESH_TAP 0x1D //Tap Threshold
#define OFSX 0x1E //X-axis offset
@hamaluik
hamaluik / !Profiler.hx
Last active April 6, 2020 23:11
Simple Haxe Profiler
package ;
import haxe.ds.StringMap;
import haxe.macro.Context;
import haxe.macro.Expr;
import haxe.macro.Printer;
import haxe.macro.Type.ClassType;
import neko.Lib;
using haxe.macro.ExprTools;
@hamaluik
hamaluik / !DevConsole.hx
Created April 9, 2015 06:46
Showing how to use macros to get a list of all methods with a specific metadata at runtime. Very kludgey, my first attempt, but it works.
package dc;
import dc.DevConsoleInjector;
import haxe.macro.Context;
import haxe.macro.Expr;
typedef ConsoleCommand = {
var className:String;
var methodName:String;
}
@hamaluik
hamaluik / StaticTilemap.hx
Last active August 29, 2015 14:19
StaticTilemap.hx
import luxe.importers.tiled.TiledMap;
import luxe.options.TilemapOptions;
import luxe.tilemaps.Ortho;
import luxe.tilemaps.Tilemap;
import phoenix.geometry.Geometry;
import phoenix.geometry.QuadPackGeometry;
import phoenix.Rectangle;
import phoenix.Texture;
import phoenix.Vector;
@hamaluik
hamaluik / ScreenSpaceZoom.hx
Last active August 29, 2015 14:19
This will keep sprites in the same position on the screen no matter the zoom. Demo: http://luxe.blazingmammothgames.com/screenspacezoom
// demoed at: http://luxe.blazingmammothgames.com/screenspacezoom
import luxe.Color;
import luxe.Input;
import luxe.Sprite;
import luxe.Vector;
import phoenix.Batcher;
import luxe.Camera;
class Main extends luxe.Game {
var worldSprite:Sprite;