- 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
angleRad = angleDeg * Math.PI / 180;
local graphics = love.graphics | |
local TAU = math.pi * 2 | |
local p, pe | |
local MS=1 | |
local PSIZE=40 | |
function love.load() | |
graphics.setDefaultFilter('linear', 'linear', 4) |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
let noop = function() { | |
}; | |
export default class ArcadeController { | |
static factory(moveStartCallback, moveCallback, fireCallback, cbContext) { | |
return new Phaser.ArcadeController(this.game, moveStartCallback, moveCallback, fireCallback, cbContext) | |
} | |
constructor(game, moveStartCallback = noop, moveCallback = noop, fireCallback = noop, callbackContext) { | |
game.input.holdRate = 150; | |
game.input.touch.consumeDocumentTouches(); |
##Run install_syncthing.sh
$ curl -s https://gist.githubusercontent.com/hdml/7b079c114d3e20bf69f1/raw/1cd3647b1db4f80726c145fba725e27993a7fcdb/install_syncthing.sh | sudo bash
Start syncthing
$ syncthing
Wait until you get something like:
/var/lib/lxc/mycontainer/config
$HOME/.local/share/lxc/mycontainer/config
lxc.mount
directive, that follows the format below. Substitute proper paths as necessary:
lxc.mount.entry = /path/to/folder/on/host /path/to/mount/point none bind 0 0
module.exports = class AngularController | |
# register the subclass with angular, module and name are optional | |
@register: (name, module) -> | |
module ?= @module || angular.module 'controllers' | |
name ?= @name || @toString().match(/function\s*(.*?)\(/)?[1] | |
module.controller name, @ | |
# inject the list of dependencies, as a list of Strings | |
@inject: (args...) -> |
--[[ json.lua | |
A compact pure-Lua JSON library. | |
The main functions are: json.stringify, json.parse. | |
## json.stringify: | |
This expects the following to be true of any tables being encoded: | |
* They only have string or number keys. Number keys must be represented as | |
strings in json; this is part of the json spec. |