Skip to content

Instantly share code, notes, and snippets.

View DarkGuardsman's full-sized avatar
😴
5% burnout recovered

Robin Seifert DarkGuardsman

😴
5% burnout recovered
View GitHub Profile
@DarkGuardsman
DarkGuardsman / removeTextChrome.js
Created October 9, 2019 15:28
Chrome javascript snippet for strip all text from page
var body = document.getElementsByTagName("body")[0];
var iter = document.createNodeIterator (body, NodeFilter.SHOW_TEXT);
var textnode;
while (textnode = iter.nextNode()) {
if(textnode.wholeText.trim() !== '') {
textnode.nodeValue = '1';
}
}
@DarkGuardsman
DarkGuardsman / traffic_light.lmc
Created January 24, 2019 23:30
Traffic lights for little man computer
https://en.wikipedia.org/wiki/Little_man_computer
################################
# Notes for reading this program
####
# I think in OOP style so this program will not visually look like a
# linear flow of logic. It, however, does flow in a linear way but jumps around a lot.
# At the bottom of the program is all the data, above that is what I call functions.
# These functions are reusable or single instruction sets that are called in different
# places in the program. All of these functions return to the start of the program
# Where the program then checks what is our current condition before moving forward.
@DarkGuardsman
DarkGuardsman / AnnotationFinderTest.java
Last active June 20, 2018 12:52
Test to see if annotations can be found on subclass methods that were added on superclass methods
package com.buildbroken.tests;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
@DarkGuardsman
DarkGuardsman / Main.java
Created April 13, 2018 08:22
Insertion & contains check for ArrayList vs HashSet while using BlockPos
package com.builtbroken.jlib;
import com.builtbroken.jlib.lang.StringHelpers;
import icbm.classic.lib.transform.vector.Pos;
import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.function.Consumer;
@DarkGuardsman
DarkGuardsman / Main.java
Created April 13, 2018 07:47
HashSet vs ArrayList #add(BlockPos) test to check performance
package com.builtbroken.jlib;
import com.builtbroken.jlib.lang.StringHelpers;
import net.minecraft.util.math.BlockPos;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.function.Consumer;
@DarkGuardsman
DarkGuardsman / gist:36b277d2eba3bc17ccb4cb541cccdff3
Created April 13, 2018 07:18
Hash Collision check for BlockPos MC1.12 vs Pos CodingLib
package com.builtbroken.jlib;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import icbm.classic.lib.transform.vector.Pos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import java.util.Collection;
import java.util.HashSet;
public class ConfigurationDialog extends ODialog
{
private final Configuration config;
private final ObjectSwingMapper mapper;
private final FormPanel javaSettingsPanel = new FormPanel();
private final FormPanel gameSettingsPanel = new FormPanel();
private final FormPanel proxySettingsPanel = new FormPanel();
private final FormPanel advancedPanel = new FormPanel();
private final FormPanel generalSettingsPanel = new FormPanel();