Skip to content

Instantly share code, notes, and snippets.

View JakeTrock's full-sized avatar

Jacob Trock JakeTrock

View GitHub Profile
@JakeTrock
JakeTrock / Sortingalgostest.pde
Created October 11, 2018 20:19
This is a comparison of 3 sort algorithms, which times their runtimes
Timer timer=new Timer();
int numtrials=1;
int[] array;
int[] timings1;
int[] timings2;
int[] timings3;
void setup() {
for (int n = 100; n<= 2000; n+=100) {
timings1 = new int[numtrials];
@JakeTrock
JakeTrock / gif.js
Last active February 20, 2020 00:44
A simple gif processing extension for pdfkit.
import GIF from 'gifuct-js/dist/gifuct-js.js'
class GIFImage {
constructor(data, label) {
var oReq = new XMLHttpRequest();
oReq.open("GET", gifURL, true);
oReq.responseType = "arraybuffer";
oReq.onload = function (oEvent) {
var arrayBuffer = oReq.response; // Note: not oReq.responseText
#! /usr/bin/python
#improvement of Weslley S Pereira's script by Jacob Trock
try:
# Python2
import Tkinter as tk
except ImportError:
# Python3
import tkinter as tk
@JakeTrock
JakeTrock / ins.txt
Last active December 22, 2020 21:01
How to clean up installed packages list to find (most) human-installed packages
How to clean up installed packages list to find (most) human-installed packages
use this regex:
^.*(lib|-bin|conf|utils|data|kde|gnome|plugin|driver|python|xserver|theme|dev|linux|core|extra|common|settings|source|mono|doc).*$
then this escape sequence to clean it all up
\n\n
@JakeTrock
JakeTrock / mpconf.sh
Created December 22, 2020 21:37
converts a bunch of ogg files to flac and normalizes them
for f in *.ogg; do ffmpeg -i "${f%}" "${f//-/}.flac"; done
ffmpeg-normalize *.mp3 -c:a libmp3lame -b:a 320k -ext mp3
@JakeTrock
JakeTrock / setup.sh
Last active December 23, 2020 02:52
all the stuff on my setup
(GUI exts/themes)========================================
-widgets
-event calendar
-todolist
-GUI
-icon style-gnustep icons
-plasma style-commonality
-cursor style-sgi
-application style-ms windows 9x
-window decorations-CDE
@JakeTrock
JakeTrock / createScreenCapVid.sh
Created February 2, 2021 18:28
creates fake webcam with screencap video on linux
sudo apt install v4l2loopback-dkms
sudo modprobe v4l2loopback
sudo ffmpeg -loglevel verbose -f x11grab -framerate 25 -video_size 1920x1080 -i :0.0 -f v4l2 -vf format=yuyv422 /dev/video2
/* Amplify Params - DO NOT EDIT
API_name_GRAPHQLAPIENDPOINTOUTPUT
API_name_GRAPHQLAPIIDOUTPUT
ENV
REGION
Amplify Params - DO NOT EDIT */const axios = require('axios');
const gql = require('graphql-tag');
const graphql = require('graphql');
const { print } = graphql;
@JakeTrock
JakeTrock / mp3strip.sh
Last active January 1, 2022 22:13
makes an mp3 as small as possible with ffmpeg
mkdir filtered && for f in *.mp3 ; do ffmpeg -i "$f" -ab 128k -map_metadata -1 "./filtered/${f%.}.opus"; done
#/bin/bash
curl https://boot.netboot.xyz/ipxe/netboot.xyz.efi
sudo mkdir /boot/efi/EFI/rescue
sudo cp ./netboot.xyz.efi /boot/efi/EFI/rescue/
efibootmgr --create --disk /dev/sdx --part [EFI_PARTITION_NUMBER] --loader /EFI/rescue/netboot.xyz.efi --label "Netboot.xyz"