Skip to content

Instantly share code, notes, and snippets.

View polyfloyd's full-sized avatar
🇺🇦

polyfloyd

🇺🇦
View GitHub Profile
#!/bin/bash
DEV="/sys/class/backlight/intel_backlight"
set -eu
if [[ $1 == "up" ]]; then
delta=0.1
elif [[ $1 == "down" ]]; then
delta=-0.1
@polyfloyd
polyfloyd / radar.frag.glsl
Created October 8, 2017 18:10
A hollywood radar image rendered by a fragment shader for glslsandbox.com
#ifdef GL_ES
precision mediump float;
#endif
#extension GL_OES_standard_derivatives : enable
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
@polyfloyd
polyfloyd / gitea-update.sh
Created August 21, 2017 12:34
Gitea Updater
#!/bin/bash
# Downloads a binary file from the internetz and makes it executable. What could possibly go wrong? :D
INSTALL="/opt/gitea"
set -eu
set -o pipefail
path=$(curl -sL https://github.com/go-gitea/gitea/releases/latest | sed -n 's/.*<a href="\([^"]\+linux-amd64\)".*$/\1/p')
ofile=$INSTALL/$(basename "$path")
@polyfloyd
polyfloyd / Makefile
Last active August 21, 2017 12:35
Advanced C++ Makefile
# Environment checks {{{
ifdef VERBOSE
Q :=
E := @true
else
Q := @
E := @echo
# Output coloring {{{
@polyfloyd
polyfloyd / difm
Last active April 11, 2018 10:42
Simple script to listen to Digitaly Imported channels
#!/bin/bash
# Simple script to listen to Digitaly Imported channels without needing the
# abortion of a piece of software that is Flash.
if [ -e $1 ]; then
echo "Usage: $0 <channel>"
echo
echo "Available channels:"
curl "http://pub7.di.fm/" -s \