Skip to content

Instantly share code, notes, and snippets.

@CalebWhiting
CalebWhiting / runelite-latest-version.bash
Last active April 21, 2022 08:12
runelite-latest-version
#!/usr/bin/env bash
wget --no-cache -q -O - https://github.com/runelite/runelite/tags | \
grep --max-count 1 -o 'tag runelite-parent-.*$' | \
sed 's/tag runelite-parent-//'
@CalebWhiting
CalebWhiting / # ffmpeg - 2018-04-12_03-28-10.txt
Created April 14, 2018 16:55
ffmpeg on Raspbian GNU/Linux 9.4 (stretch) - Homebrew build logs
Homebrew build logs for ffmpeg on Raspbian GNU/Linux 9.4 (stretch)
Build date: 2018-04-12 03:28:10
@CalebWhiting
CalebWhiting / # util-linux - 2018-04-14_16-39-50.txt
Created April 14, 2018 16:48
util-linux on Raspbian GNU/Linux 9.4 (stretch) - Homebrew build logs
Homebrew build logs for util-linux on Raspbian GNU/Linux 9.4 (stretch)
Build date: 2018-04-14 16:39:50
@CalebWhiting
CalebWhiting / Main.java
Last active December 4, 2017 21:59
Demonstrates the effect of reflection on performance.
import java.lang.reflect.Method;
import java.util.stream.LongStream;
public class Main {
/**
* Run each test this many times to get a minimum, average, maximum value
*/
private static final int TEST_ATTEMPTS = 5000;
@CalebWhiting
CalebWhiting / update-wallpapers.sh
Created October 17, 2017 19:12
update-wallpapers
#!/bin/bash
#
# (re)generates a .xml file pointing to a list of wallpapers found withing ~/.wallpapers, these pictures
# should then be visible within the 'Wallpapers' tab of the gnome wallpaper switcher.
#
# This needs to be ran as root.
# Optionally you can change the permissions of the directory '/usr/share/gnome-background-properties/'
# and it's contents to allow user r/w
#
WALLPAPERS="$HOME/.wallpapers"
@CalebWhiting
CalebWhiting / ufw-replace.sh
Last active October 17, 2017 16:19
ufw-replace
#!/bin/bash
# Syntax: 'ufw-replace <comment> <ufw parameter>...'
# Example: 'ufw-replace open-torrent-port allow 40340/tcp'
comment="$1"
if [ "$comment" = '' ]; then echo 'No comment provided!' && exit -1 ; fi
shift
args="$@"
if [ "$args" = '' ]; then echo 'Too few arguments' && exit -1 ; fi
#####################################################################
echo "Looking for rules with comment: '$comment'"
@CalebWhiting
CalebWhiting / to-string-format.vm
Created December 30, 2016 21:09
Template for IntelliJ IDEA to generate toString methods with String.format
public java.lang.String toString() {
return String.format(##
"$classname [ ##
#set ($i = 0)
#foreach ($member in $members)
#if ($i != 0)
, ##
#end
#if ($member.numeric)
$member.name=%d##
package com.unicus.api.wrapper;
import com.unicus.reflect.FieldReference;
import com.unicus.reflect.MethodReference;
import com.unicus.reflect.ReflectContext;
/**
* @author Caleb Whiting
*/
public abstract class Wrapper {
package com.unicus.api.wrapper.collection;
import com.unicus.api.wrapper.*;
/**
* @author Caleb Whiting
*/
public class Node extends Wrapper {
public Node(Object reference) {
package com.unicus.api.wrapper;
import com.unicus.reflect.FieldReference;
import com.unicus.reflect.MethodReference;
import com.unicus.reflect.ReflectContext;
/**
* @author Caleb Whiting
*/
public abstract class Wrapper {