Skip to content

Instantly share code, notes, and snippets.

View JohnMeyerhoff's full-sized avatar

John JohnMeyerhoff

  • Germany
View GitHub Profile
@JohnMeyerhoff
JohnMeyerhoff / RDVL.java
Created April 30, 2023 23:15
Doppelt Verkettete Liste mit Ring
import java.util.NoSuchElementException;
public class RDVL<T> { // Ring doppelt verkettete Liste
private Listenelement current; // Zeiger auf Start der Liste != first weil ein Ring keinen wirklichen Anfang
// hat
private int size = 0;
public class Listenelement {
Listenelement prev;
Listenelement next;
@JohnMeyerhoff
JohnMeyerhoff / DynamicArray.java
Created February 1, 2022 14:29
Dynamic Generic Array
import java.util.Iterator;
public class DynamicArray<I> implements Iterable<I> {
class ArrayIterator implements Iterator<I> {
int bookmark = 0;
@Override
public boolean hasNext() {
return bookmark<size()-1;
}
@JohnMeyerhoff
JohnMeyerhoff / History|-35a860a9|entries.json
Last active August 10, 2022 11:02
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/horus/Documents/testrust/experiments/src/main.rs","entries":[{"id":"EEM9.rs","timestamp":1660063147955},{"id":"EVOB.rs","timestamp":1660075929929},{"id":"oGUo.rs","timestamp":1660076313239},{"id":"aAhK.rs","timestamp":1660076324435},{"id":"noPJ.rs","timestamp":1660076343222},{"id":"IBJD.rs","timestamp":1660076469847},{"id":"zqW7.rs","timestamp":1660076602602},{"id":"brqK.rs","timestamp":1660076785485},{"id":"hXVA.rs","timestamp":1660076875727},{"id":"mFvF.rs","timestamp":1660076897603},{"id":"pVmt.rs","source":"undoRedo.source","timestamp":1660076905425},{"id":"NuEu.rs","timestamp":1660076922190},{"id":"SsK9.rs","timestamp":1660076945187},{"id":"SJ3h.rs","timestamp":1660077058863},{"id":"vwIf.rs","timestamp":1660127444041},{"id":"4Cs2.rs","timestamp":1660127585899},{"id":"ThZY.rs","timestamp":1660127624489},{"id":"JB2d.rs","timestamp":1660127748473},{"id":"KY10.rs","timestamp":1660127766131},{"id":"Kp8L.rs","timestamp":1660127807727},{"id":"wqau.rs","timestamp":166012783
@JohnMeyerhoff
JohnMeyerhoff / Flipswitch.java
Last active May 31, 2022 18:52
Reissverschlussverfahren mit zwei Arrays
import java.util.Arrays;
public class Flipswitch {
public static void main(String[] args) {
int[] rechts = { 1, 2, 3, 4, 5, 6 };
int[] links = { 147, 99, 31, 231, 142, 412, 421, 421, 241 };
int[] zip = flipswitch(links, rechts);
System.out.println(Arrays.toString(links));
System.out.println(Arrays.toString(rechts));
System.out.println("Reissverschluss:");
@JohnMeyerhoff
JohnMeyerhoff / addnewsshconnection.sh
Last active March 18, 2019 09:14
Creating a new ssh config for ssh connections to a server.
if [ $# -ne 2 ]; then
echo "this script works for ~/.ssh/ and uses the filename from \n
your first argument and the server from your second argument"
echo "example: $1 keyname_rsa [email protected]"
exit 1
fi
#not checking if second argument contains @.
echo "generating ssh-key with specified name:"
echo ~/.ssh/$1 | ssh-keygen