View drawlib.cs
public class SEFix { | |
public static T[] arr<T>(params T[] arg) { | |
return arg; //becuse SE is stupid | |
} | |
} | |
public class ColorUtils { | |
private static double oo64 = 1.0/64.0; | |
private static double[][] map = new double[][] { | |
new double[] { 0*oo64, 48*oo64, 12*oo64, 60*oo64, 3*oo64, 51*oo64, 15*oo64, 63*oo64}, | |
new double[] {32*oo64, 16*oo64, 44*oo64, 28*oo64, 35*oo64, 19*oo64, 47*oo64, 31*oo64}, |
View make_second_plank.sh
#!/bin/bash | |
plank -n dock2 & | |
kill $! | |
printf "Monitor: " | |
read monitor | |
echo "Using $monitor as monitor" | |
gsettings reset-recursively net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock2/ | |
for key in $(gsettings list-keys net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/); do | |
val=$(gsettings get net.launchpad.plank.dock.settings:/net/launchpad/plank/docks/dock1/ $key) |
View Bluetooth Thing
# Put the .service files in /etc/systemd/system/ | |
# and the btstate file in /usr/local/bin/ | |
# Then run these commands. | |
sudo chmod +x /usr/local/bin/btstate | |
sudo systemctl enable btstate.service | |
sudo systemctl enable btstate-startonwake.service | |
# You might have to change "hci0" in the /usr/local/bin/btstate file to | |
# whatever your bluetooth device is called. You can find it by running |
View prettyprint.lua
function utf8_length(str) | |
return select(2, str:gsub('[^\128-\193]', '')) | |
end | |
function box_reverse(str) | |
local map = { | |
["─"] = "─", | |
["│"] = "│", | |
["└"] = "┘", | |
["┌"] = "┐", | |
["┼"] = "┼", |
View irc.vala
namespace TwitchChat { | |
public class Chat { | |
public string name; | |
public string streamer { | |
owned get { | |
return name.substring(1); | |
} | |
} | |
public string[] users; |
View nowplaying
#!/usr/bin/env python3 | |
from PIL import Image | |
from PIL import ImageDraw | |
from PIL import ImageFont | |
import gi | |
gi.require_version('Playerctl', '2.0') | |
from gi.repository import Playerctl, GLib |
View cubeviewer.cs
public class CubeViewer { | |
private static int[][] cubeSides = new int[][] { | |
SEFix.arr( | |
1, 1,-1, | |
1, 1, 1, | |
-1, 1, 1, | |
-1, 1,-1 | |
), SEFix.arr( | |
-1, 1,-1, | |
-1, 1, 1, |
View drawlib.cs
public class ColorUtils { | |
private static double oo64 = 1.0/64.0; | |
private static double[][] map = new double[][] { | |
new double[] { 0*oo64, 48*oo64, 12*oo64, 60*oo64, 3*oo64, 51*oo64, 15*oo64, 63*oo64}, | |
new double[] {32*oo64, 16*oo64, 44*oo64, 28*oo64, 35*oo64, 19*oo64, 47*oo64, 31*oo64}, | |
new double[] { 8*oo64, 56*oo64, 4*oo64, 52*oo64, 11*oo64, 59*oo64, 7*oo64, 55*oo64}, | |
new double[] {40*oo64, 24*oo64, 36*oo64, 20*oo64, 43*oo64, 27*oo64, 39*oo64, 23*oo64}, | |
new double[] { 2*oo64, 50*oo64, 14*oo64, 62*oo64, 1*oo64, 49*oo64, 13*oo64, 61*oo64}, | |
new double[] {34*oo64, 18*oo64, 46*oo64, 30*oo64, 33*oo64, 17*oo64, 45*oo64, 29*oo64}, | |
new double[] {10*oo64, 58*oo64, 6*oo64, 54*oo64, 9*oo64, 57*oo64, 5*oo64, 53*oo64}, |