Skip to content

Instantly share code, notes, and snippets.

View XANOZOID's full-sized avatar
♾️
You can not win.

Xanozoid XANOZOID

♾️
You can not win.
  • The machine
View GitHub Profile
@XANOZOID
XANOZOID / MIT-License.txt
Created July 15, 2017 06:57
This license applies to all public, or otherwise noted, gists for https://gist.github.com/forgotten-king
All public gists https://gist.github.com/forgotten-king
Copyright 2017, Abrahim Noll
MIT License, http://www.opensource.org/licenses/mit-license.php
@XANOZOID
XANOZOID / IsometricGrid-misc.hx
Last active July 16, 2017 01:36
Haxe utility class which provides you with some useful isometric functions!
package;
typedef PosArr = Array<Float>;
/**
Isometric translation formulas used and explanations can be found at:
https://yal.cc/understanding-isometric-grids/
- Disclaimer: This code is not associated with yal.cc, simply a Haxe implementation
- See license on https://gist.github.com/forgotten-king
*/
class IsometricGrid{
// Isometric cell width
@XANOZOID
XANOZOID / ShiftedComponent.hx
Created July 19, 2017 02:40
An adaption to normal component paths in Luxe
class ShiftedComponent extends luxe.tween.ComponentPath implements luxe.tween.IComponentPath {
//var _shiftedComp : luxe.tween.ComponentPath;
//public var start(get_start,set_start):Float;
//public var end (get_end, null):Float;
var _shifted: Float;
public function new( path: luxe.tween.ComponentPath, shifted: Float ){
//_shiftedComp = path;
super();
@XANOZOID
XANOZOID / KinematicPlatformer2d.gd
Last active February 7, 2022 02:59
Godot easy and composable slopes platformer code (DEMO: https://media.giphy.com/media/iPQssOxSZ61Zm/giphy.gif )
# Please credit "Ghouly The Ghost" out of your kind heart! Check my gist page for a license.
# Includes: No slip inclines, variable angle climbing, shape agnostic implementation, slope climb up/down, smooth old school vertical collisions
# WARNING! IMPORTANT!: Relies on " Scene >> Projects Settings >> Physics 2D >> motion_fixed_enabled[x] __ on[x]"
extends KinematicBody2D
const floorCheckVector = Vector2( 0, 1 )
const normalCheckVector = Vector2( 0, -1 )
var angleThreshold = 1.39 setget set_angle_threshold
var slopeScale = tan( angleThreshold )
#include <IOShieldOled.h>
const int ledPin = 13;
const int sensorPin = A0;
int BUTTON[] = { 4, 78 };
int SWITCH[] = { 2, 7, 8, 79 };
int accel = 0;
int velocity = 0;
int postLine = 0;
boolean cruiseOn = false;
@XANOZOID
XANOZOID / extension_fixer.js
Last active October 31, 2017 07:16
Fixes incorrect, specified, file extensions in a specified directory
/* usage: `node extension_fixer.js ext-name (/)sub-folder */
/* sub folder is optional. */
/**
* Goes over all files in the current directory
* - checks if they have an incorrect extension name
* - prints out the conflict
* - changes their file name.
* --- Limitations:
* Only fixes letter-case conflicts.
*/
-cp ..
-cp src
-main TestMain
-lib munit
-lib hamcrest
--no-inline
--each
-D unit_test
@XANOZOID
XANOZOID / NetClient.cc
Created December 15, 2017 00:58 — forked from floooh/NetClient.cc
NetClient.h (emscripten/osx/win)
//------------------------------------------------------------------------------
// NetClient.cc
//------------------------------------------------------------------------------
#if ORYOL_WINDOWS
#define _WINSOCK_DEPRECATED_NO_WARNINGS (1)
#include <WinSock2.h>
typedef int ssize_t;
#endif
#if ORYOL_POSIX
@XANOZOID
XANOZOID / MakeConvex.monkey2
Last active March 15, 2019 07:15
Monkey2 Polygon Decomposition
Namespace polygonmath
#Import "<std>"
Using std..
#rem Decomposes counter-clockwise simple polygons into convex polygons in under-quadratic time.
@author Matrefeytontias
@engine HaxePunk
@XANOZOID
XANOZOID / what-is-svelte.md
Created November 18, 2019 06:23 — forked from Rich-Harris/what-is-svelte.md
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question: