Skip to content

Instantly share code, notes, and snippets.

View MiniDigger's full-sized avatar
👋

MiniDigger | Martin MiniDigger

👋
View GitHub Profile
@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@marcelmaatkamp
marcelmaatkamp / gist:123e8793e07a72a382d8d0e8d66bbd8f
Last active March 26, 2024 10:13
Fix Sonatype Nexus OrientDB
$ ls /opt/sonatype/sonatype-work/nexus3/db/
OSystem accesslog analytics audit component config model.properties security
$ docker-compose exec nexus java -jar ./lib/support/nexus-orient-console.jar
CONNECT PLOCAL:/opt/sonatype/sonatype-work/nexus3/db/component admin admin
REBUILD INDEX *
REPAIR DATABASE --fix-graph
REPAIR DATABASE --fix-links
REPAIR DATABASE --fix-ridbags
@MiniDigger
MiniDigger / StructureUtil.java
Last active May 27, 2021 09:07
Small util to load and save structures, using nms and reflection
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.util.Vector;
/**
* Small util to load and save structures<br>
@psayre23
psayre23 / gist:c30a821239f4818b0709
Last active April 15, 2024 14:39
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array