Skip to content

Instantly share code, notes, and snippets.

View keyle's full-sized avatar
👾

keyle

👾
View GitHub Profile
(function($) {
// My micro jQuery templating engine
// Usage:
//
// <section data-html="content"></section>
//
// Will load <content.html> into <section>
$(document).ready(function() {
import macros
macro eval(s: string): expr =
result = parseStmt($s)
eval("echo 5")
@keyle
keyle / readme.md
Created October 25, 2019 06:10 — forked from xem/readme.md
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;