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
@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 / 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 / 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
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-surround'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'scrooloose/nerdtree'
Plug 'terryma/vim-multiple-cursors'
"Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'morhetz/gruvbox'
Plug 'godlygeek/tabular'
Plug 'junegunn/goyo.vim'
@hamaluik
hamaluik / cppLinearInterpolator
Created January 15, 2013 04:53
Basic linear interpolator class in C++
#include <map>
#include <vector>
/**
* Provides a basic interpolation mechanism in C++ using the STL.
* Maybe not the fastest or most elegant method, but it works (for
* linear interpolation!!), and is fast enough for a great deal of
* purposes. It's also super easy to use, so that's a bonus.
*/
class LinearInterpolator {
@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;
#!/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
[bar/i3wmthemer_bar]
width = 100%
height = 27
radius = 0
fixed-center = true
background = #162025
foreground = #bfbfbf
line-size = 3
while let Some(c) = self.chars.peek() {
match c {
'\n' => { self.line += 1; },
'"' => { break; },
_ => { self.advance(); }
};
}