Skip to content

Instantly share code, notes, and snippets.

View notanimposter's full-sized avatar

Logan notanimposter

  • Wolfram & Hart
  • Right behind you
View GitHub Profile
@notanimposter
notanimposter / Bluetooth Thing
Last active June 30, 2020 06:16
Stop bluetooth from turning on everytime the computer wakes up
# 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
@notanimposter
notanimposter / prettyprint.lua
Created June 15, 2020 07:36
A function for displaying tables... prettily
function utf8_length(str)
return select(2, str:gsub('[^\128-\193]', ''))
end
function box_reverse(str)
local map = {
["─"] = "─",
["│"] = "│",
["└"] = "┘",
["┌"] = "┐",
["┼"] = "┼",
@notanimposter
notanimposter / irc.vala
Created June 15, 2020 07:26
A work-in-progress IRC/Twitch chat library in Vala
namespace TwitchChat {
public class Chat {
public string name;
public string streamer {
owned get {
return name.substring(1);
}
}
public string[] users;
@notanimposter
notanimposter / make_second_plank.sh
Created March 13, 2020 18:17
make a second plank for your second monitor
#!/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)
@notanimposter
notanimposter / nowplaying
Created March 8, 2020 19:51
A now playing script for MPRIS and OBS (to be run as a systemd user service). Change the file path, music player name, etc. to whatever works for you
#!/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
@notanimposter
notanimposter / cubeviewer.cs
Created February 13, 2016 22:27
3D rendering in Space Engineers (depends on drawlib.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,
@notanimposter
notanimposter / drawlib.cs
Last active March 29, 2023 11:27
Drawing library for SE v2.4
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},
@notanimposter
notanimposter / drawlib.cs
Last active January 12, 2016 23:35
SE drawing library (version 2)
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},