Skip to content

Instantly share code, notes, and snippets.

View carneeki's full-sized avatar

Adam carneeki

View GitHub Profile
@carneeki
carneeki / i3-bindings-gnome.sh
Created December 1, 2018 11:29
Set some keybindings for GNOME to be similar to i3
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-1 "['<Super>1']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-2 "['<Super>2']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-3 "['<Super>3']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-4 "['<Super>4']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-5 "['<Super>5']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-6 "['<Super>6']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-7 "['<Super>7']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-8 "['<Super>8']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-9 "['<Super>9']"
@carneeki
carneeki / installer.zsh
Last active August 11, 2018 13:15
ytGhostBuster scans all your favourite edgey channels for vids that might get deleted, and saves them before they're taken down. Run frequently with a scheduler.
#!/usr/bin/zsh
SCRIPTDIR=~/.local/bin/
TIMERSDIR=~/.config/systemd/user/
sedstring="s/REPLACEME/$(whoami)/g"
mkdir -p $SCRIPTDIR
cp ytGhostBuster.py $SCRIPTDIR/ytGhostBuster.py
@carneeki
carneeki / fucan.zsh
Last active June 29, 2018 15:39
FUCAN compile scripts
#!/usr/bin/zsh
DESTHOST="fucan.local"
DESTHOME="/home/carneeki"
SRCHOME="/home/carneeki"
BUILDDIR="/tmp/carneeki"
UGS_SRCDIR="$SRCHOME/Sources/ugs"
UGS_BUILDDIR="$BUILDDIR/ugs"
UGS_SRCZIP="$UGS_BUILDDIR/ugs-platform/application/target/ugs-platform-app-2.0-SNAPSHOT.zip"
@carneeki
carneeki / slic3r-prusa3d.desktop
Created June 19, 2018 00:54
Update slic3r-prusa3d.desktop to pass desktop-file-validate and open STL files from GUI
[Desktop Entry]
Version=1.0
Type=Application
Name=Slic3r Prusa Edition
Icon=slic3r-prusa3d
Exec=/usr/bin/slic3r-prusa3d --gui %F
StartupNotify=false
StartupWMClass=Slic3r-prusa3d.pl
MimeType=application/stl;
@carneeki
carneeki / kiwiTest.c
Created January 31, 2017 03:49
Test of Kiwi Drive
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/*
* Simple C program to give test parameters for Kiwi Drive robot: x, y, p
* Two joysticks required:
* one provides vector of robot direction ('x' + 'y' components),
* the other provides pivot component (one axis only, called 'p')
* Values are input on command line as space separated values: x y p
@carneeki
carneeki / .bashrc
Created January 31, 2017 02:45
bashrc for weather updates with wttr.in
# Add a function to get weather refreshed every ten minutes to terminal
# using wttr.in. Can be used as follows:
# wttr Arlen # Fictional town in Texas
# wttr KSGF # ICAO code for Springfield, Missouri
# wttr # Use a default location in code below
#
# See wttr.in/:help for more details
wttr()
{
tmpfile=$(mktemp /tmp/wttr.XXXXXX)
@carneeki
carneeki / Kiwi.java
Created January 28, 2017 07:47
possible KiwiDrive example code for 4802
public class Kiwi
{
SafePWM s1 = new SafePWM(0); // motor 1 pwm port 0
SafePWM s2 = new SafePWM(1); // motor 2
SafePWM s3 = new SafePWM(2); // motor 3
private final double[][] inversion = { {2/3, 0, 1/3}, {-1/3, 1/sqrt(3), 1/3}, {-1/3, -1/sqrt(3), 1/3}};
public Kiwi()
{
@carneeki
carneeki / RGBFlash.ino
Created August 24, 2016 04:32
flash red -> green -> blue
// RGB flasher for Darius :D
int red = 3;
int blu = 5;
int grn = 9;
void setup() {
pinMode(red, OUTPUT);
pinMode(grn, OUTPUT);
pinMode(blu, OUTPUT);
digitalWrite(red, LOW);
import java.util.ArrayList;
public class FSM
{
public class State
{
final boolean acceptor;
private final int num;
final int r0; // what to return if given zero
final int r1; // what to return if given one
@carneeki
carneeki / AutoTest.ino
Created March 14, 2016 10:26
Autonomous Board Test for Team 4802 in FRC game 2016
/*
* Autonomous Board Test
*
* Test an individual switch for Autonomous on the RoboRIO for BGHS/4802 in the
* 2016 FRC game.
*/
void setup()
{
// send serial to the PC