Skip to content

Instantly share code, notes, and snippets.

View drhayes's full-sized avatar
🐱

David Hayes drhayes

🐱
View GitHub Profile
@hdml
hdml / - Syncthing + start on boot.md
Last active November 22, 2023 19:26
How to install Syncthing on Raspberry Pi + start on boot [semi-automatic]

##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:

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();
@rauchg
rauchg / README.md
Last active April 13, 2025 04:29
require-from-twitter
@xem
xem / readme.md
Last active July 1, 2025 21:09
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;

@josephg
josephg / main.lua
Created October 7, 2016 04:21
Pretty love2d particles
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)
@jorio
jorio / Shake.js
Last active November 30, 2016 15:53
custom Shake implementation for Phaser 2 (transpiled from Shake.ts)
"use strict";
var Shake = (function () {
function Shake(game) {
this.game = game;
}
/**
* @param {number} amp amplitude in pixels
* @param {number} duration
* @param {boolean} x shake on X axis
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active July 12, 2025 14:53
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@josefnpat
josefnpat / Makefile
Last active February 5, 2025 05:46
Love Makefile of Doom
# Copyright 2017 Josef N Patoprsty
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@alexellis
alexellis / k8s-pi.md
Last active June 28, 2025 05:44
K8s on Raspbian
@DasWolke
DasWolke / microservice bots.md
Last active June 28, 2025 21:57
Microservice bots

Microservice Bots

What they are and why you should use them

Introduction

Recently more and more chatbots appear, the overall chatbot market grows and the platform for it grows as well. Today we are taking a close look at what benefits creating a microservice chatbot on Discord - (a communication platform mainly targeted at gamers) would provide.

The concepts and ideas explained in this whitepaper are geared towards bots with a bigger userbase where the limits of a usual bot style appear with a greater effect

Information about Discord itself

(If you are already proficient with the Discord API and the way a normal bot works, you may skip ahead to The Concept)