Skip to content

Instantly share code, notes, and snippets.

View martin-braun's full-sized avatar
♠️

Martin Braun martin-braun

♠️
View GitHub Profile
@martin-braun
martin-braun / gpm
Last active August 17, 2021 23:00
gpm - Lightweight Git Package Manager
#!/bin/bash
me=`basename "$0"`
if [[ -z $1 || $1 == "-h" || $1 == "--help" ]]; then
echo "Usage: $me <op[ install | i | update | u | force_update | fu | uninstall | un | list | l ]?> <source_platform[ github | gitlab ]> <source_name[ <author,groups>/<repo_name> ]> <protocol[ https | ssh ]?>"
else
op="$1"
force=0
if [[ $op == "force_update" || $op == "fu" ]]; then
op="u"
@martin-braun
martin-braun / main.lua
Created January 19, 2020 04:21
Pulsing Shapes using the LÖVE framework
local lg, lt = love.graphics, love.timer
local pi, cos, sin = math.pi, math.cos, math.sin
local centerX, centerY = 400, 300
local wave = 0
-- rotate x,y around xRef,yRef by r
function rotateAround(x, y, xRef, yRef, r)
local c, s = cos(r), sin(r)
return c * (x - xRef) - s * (y - yRef) + xRef, s * (x - xRef) + c * (y - yRef) + yRef
end
@martin-braun
martin-braun / main.lua
Created January 18, 2020 21:03
Shape transformer experiment using LÖVE
local x, y = 400, 300
local lineLength = 150
local rotationChange = -0.003
function rotateAround(x1, y1, x2, y2, r)
local c, s = math.cos(r), math.sin(r)
return c * (x1 - x2) - s * (y1 - y2) + x2, s * (x1 - x2) + c * (y1 - y2) + y2 -- rotate x1,y1 around x2,y2 by r
end
local c, curR, addR
@ECHO OFF
ECHO Press any key to PARTY ...
PAUSE>NUL
CLS
SET COLORS=1 2 3 4 5 6 7 8 9 A B C D E F
FOR /L %%N IN () DO (
FOR %%A IN (%COLORS%) DO (
COLOR %%A0
)
)
@martin-braun
martin-braun / steady.lua
Last active August 17, 2018 09:50 — forked from pablomayobre/steady.lua
Fixed time step love.run
--MIT License
--Copyright (c) 2018 Arvid Gerstmann, Jake Besworth, Max, Pablo Mayobre, LÖVE Developers
--Original author: https://github.com/Leandros
--Max frame skip: https://github.com/jakebesworth
--Manual garbage collection: https://github.com/Geti
--Put it all together: https://github.com/Positive07
--Ported to 10.0.2: https://github.com/MartyMaro/
--Original love.run: LÖVE Developers