Skip to content

Instantly share code, notes, and snippets.

@BjoernSchilberg
BjoernSchilberg / pico-8-volume.py
Created December 4, 2021 22:02 — forked from follower46/pico-8-volume.py
Adds volume control to PICO-8 on the gameshell
# you need to `sudo pip install pyxhook` as it's used to intercept the volume presses
# you will also want to update your launcher to call this script (I just have mine in the pico-8 directory
# and have my PICO-8.sh run:
# SDL_VIDEODRIVER=x11 DISPLAY=:0 python /home/cpi/pico-8/pico-8-volume.py
# video of what it looks like: https://www.youtube.com/watch?v=BAoYapdMiPM
import pygame
import os
import pyxhook
import alsaaudio
@BjoernSchilberg
BjoernSchilberg / Ebiten-with-Leap.go
Created December 15, 2021 20:25 — forked from YamiOdymel/Ebiten-with-Leap.go
Ebiten with Leap Motion written in Golang
package main
import (
"fmt"
"image/color"
"math"
"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/ebitenutil"
"github.com/jaxi/motion"
@BjoernSchilberg
BjoernSchilberg / go.mod
Created February 16, 2022 07:20 — forked from samwightt/go.mod
Ebiten example with perlin noise generation
module samw.dev/ebiten
go 1.15
require (
github.com/aquilax/go-perlin v1.1.0
github.com/hajimehoshi/ebiten/v2 v2.2.4
)
@BjoernSchilberg
BjoernSchilberg / zsh-stats.py
Created February 26, 2022 20:08 — forked from kokoscript/zsh-stats.py
Stats from .zsh_history
import time
import re
hist = []
commands = []
count = 0
trueCount = 0
# by year
yearCounts = {}
monthCounts = {}
@BjoernSchilberg
BjoernSchilberg / tetris.py
Created December 8, 2022 18:49 — forked from timurbakibayev/tetris.py
Tetris game in Python
import pygame
import random
colors = [
(0, 0, 0),
(120, 37, 179),
(100, 179, 179),
(80, 34, 22),
(80, 134, 22),
(180, 34, 22),
# juggling_balls_game.py
import turtle
import time
import random
from juggling_balls import Ball
# Game parameters
WIDTH = 600
# juggling_balls.py
import random
import turtle
class Ball(turtle.Turtle):
MAX_VELOCITY = 5
GRAVITY = 0.07
BAT_VELOCITY_CHANGE = 8
@BjoernSchilberg
BjoernSchilberg / Makefile
Created May 4, 2023 08:24 — forked from alexedwards/Makefile
Boilerplate Makefile for Go projects
# Change these variables as necessary.
MAIN_PACKAGE_PATH := ./cmd/example
BINARY_NAME := example
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
@BjoernSchilberg
BjoernSchilberg / LICENSE.txt
Created May 4, 2023 20:34 — forked from addyosmani/LICENSE.txt
Offline Text Editor in < 140 bytes (115 bytes). Powered by localStorage & contentEditable
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Copyright (C) 2014 ADDY OSMANI <addyosmani.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@BjoernSchilberg
BjoernSchilberg / journalctl.txt
Last active August 12, 2023 21:23 — forked from MrAndrewMal/journalctl.txt
How to read live-tail logs of multiple services with journalctl
#Systemd - How to read live-tail logs of multiple services with journalctl
sudo journalctl --follow _SYSTEMD_UNIT=docker.service + _SYSTEMD_UNIT=apache2.service
Hint:
https://serverfault.com/questions/805775/journalctl-how-to-display-colors-in-its-output/893763#893763
If the original daemon output is already colorized, but the colors are being lost when using journalctl, the `--output cat` option will restore them.