Skip to content

Instantly share code, notes, and snippets.

View SnuktheGreat's full-sized avatar

Snuk the Great SnuktheGreat

  • @timeseriesnl
  • Utrecht, The Netherlands
View GitHub Profile
@SnuktheGreat
SnuktheGreat / readme.md
Last active December 3, 2023 11:13
Auto playing SVG keyframe animation

SVG file embedded with Javascript <script> to play a keyframed animation. Looks for layers named frame_X, where X is parsed as the frame number.

You can add the following HTTP query paramaters for additional control:

  • fps (default: 12)
  • reload (default: false) - Reload after one full animation

The rotating star is not the best example, since rotation can be done by SVG animations. I may update this with a proper example at some point.

Based on https://www.reddit.com/r/Inkscape/comments/ut05ra/keyframe_animation_svg_open_in_browser_to_play/

@SnuktheGreat
SnuktheGreat / modlist.md
Last active October 20, 2020 02:20
Fallout 4 VR mod list

Fallout 4 VR playthrough modlist

@SnuktheGreat
SnuktheGreat / vault_find.sh
Created July 18, 2017 11:57
Script to use "vault list" to find stuff in vault.
#!/usr/bin/env bash
if [ $# -lt 1 ] || [ $# -gt 2 ]; then
cat << EOF
Usage: vault_find [needle] [haystack*]
Searches through the entire vault directory to find the given needle in the given haystack.
Warning: This script uses "vault list" and can be quite slow.
options:
@SnuktheGreat
SnuktheGreat / dcqlsh
Last active May 8, 2017 16:02
Docker wrapper for cqlsh
#!/usr/bin/env bash
CONTAINER=""
CQLSH=()
# Parse options
while [[ $# -gt 0 ]]
do
key="$1"
@SnuktheGreat
SnuktheGreat / git_replace_commit
Created April 26, 2017 08:45
This very specific bash script is used to amend commits in a git tree and then rebase all affected branches and move all affected tags to the new commit. Crazy and dangerous, but better than doing it manually all the time.
#!/usr/bin/env bash
set -e
OLD_BASE=$1 # v1.0.0-step-1
ADDITION=$2
N=$'\n'
ME="$( basename ${BASH_SOURCE[0]} )"
DRY_RUN=false
@SnuktheGreat
SnuktheGreat / StreamFiles.java
Created March 25, 2017 08:33
List files in a Stream recursively (depth-first)
import java.io.File;
import java.util.Arrays;
import java.util.stream.Stream;
public class StreamFiles {
public static Stream<File> recursive(File file) {
File[] listed = file.listFiles();
if (listed == null) {
return Stream.of(file);
}
@SnuktheGreat
SnuktheGreat / vault_copy
Created September 28, 2016 10:28
vault bash scripts
#!/bin/sh
if [ $# -gt 2 ] || [ $# -lt 1 ]
then
echo 'Specify the path to the value first and optionally the field name second.' 1>&2
exit 0
fi
if [ $# -eq 2 ]
then
@SnuktheGreat
SnuktheGreat / caesar
Created May 3, 2016 15:22
Simple caesar cipher bash script
#!/bin/sh
if [ $# -ne 2 ] || [ $1 -lt -36 ] || [ $1 -gt 35 ]
then
echo 'Please specify how many random words would you like to generate !' 1>&2
echo 'example: caesar 5 "mjh5i9n 9pio 8jhpn"' 1>&2
echo 'This will do a caesar cipher of 5 places on the given string, returning romanes eunt domus' 1>&2
exit 0
fi
@SnuktheGreat
SnuktheGreat / FormattedException.java
Created February 19, 2016 16:40
Exception type that allows developers to use log4j style message formats and arguments for both the message and exception cause.
import org.slf4j.helpers.FormattingTuple;
import org.slf4j.helpers.MessageFormatter;
/**
* Base {@link Exception} class that allows developers to use the log4j message style formats to create exception messages
* and pass along exception causes.
*/
public class FormattedException extends Exception {
public FormattedException(String format, Object... arguments) {
@SnuktheGreat
SnuktheGreat / collectionEqualsTest.java
Created February 3, 2016 14:48
Simple test to proof equals works for similar collection types.
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.google.common.collect.ImmutableList;