Skip to content

Instantly share code, notes, and snippets.

View simpleauthority's full-sized avatar
🤖
computing...

Jacob Andersen simpleauthority

🤖
computing...
  • California, USA
View GitHub Profile
from vpython import *
# design
scene.title = "<h1>Magnetic Bottle Simulation</h1><p>Electron initially stuck in a magnetic bottle. The particle will corkscrew within the bottle until it hits a loss cone (not depicted) at which point<br />it will leave the system. Simulation does not stop on its own. Press \"Stop simulation\" or close the page when done.<br />"
scene.width = 960
scene.height = 720
scene.background = vec(161, 152, 151) / 255
# constants
ring_radius = 0.105 # radius of ring, meters
MergeSort(arr, low, high):
arr = array of unsorted integers
low = integer, initially 0
high = integer, initially size(arr) - 1
if low >= high then return
mid = floor((low + high) / 2)
MergeSort(arr, low, mid)
@simpleauthority
simpleauthority / get.sh
Last active August 6, 2020 21:51
Get the latest server.properties from the latest available Paper server
#!/bin/sh
CDIR=$(pwd)
rm -rf /tmp/paper
mkdir /tmp/paper
cd /tmp/paper
echo "Determing latest MC version from Paper..."
curl -s "https://papermc.io/api/v1/paper" | grep '"versions"' | awk -F '"' '{ print $8 }' > ./latest-paper
echo "Latest version is $(cat ./latest-paper)!"
@simpleauthority
simpleauthority / GlobalEventListener.java
Last active May 18, 2020 15:21 — forked from MiniDigger/GlobalEventListener.java
GlobalEventListener for Spigot/Bukkit, licenced under GPLv3
package me.minidigger.test.test;
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

Keybase proof

I hereby claim:

  • I am simpleauthority on github.
  • I am vspctr (https://keybase.io/vspctr) on keybase.
  • I have a public key whose fingerprint is BE39 8E85 8C43 FC84 E34C 5B02 D567 7A29 21F8 E4BA

To claim this, I am signing this object:

@simpleauthority
simpleauthority / PermutationGenerator.kt
Created May 30, 2019 03:48
Fill in the given format and any unknowns with a * and the program will replace the *s with possible variations. Read through the output to try and figure out the string that you forgot.
fun main() {
// Type what you know here, and replace unknowns with the star symbol (*). The more star symbols you have
// the more permutations you will have. This increases exponentially.
val givenFormat = "myemailwithm**singcha*s@gmail.com"
// DO NOT CHANGE ANYTHING BEYOND THIS LINE
val generator = PermutationGenerator(givenFormat)
generator.generate()
}
@simpleauthority
simpleauthority / MineSkinClient.java
Last active January 2, 2019 03:27
MineSkin.org client to easily upload and retrieve skins from URLs, image files, or current Player Unique IDs.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.async.Callback;
import com.mashape.unirest.http.exceptions.UnirestException;
import java.io.File;
import java.util.UUID;
import java.util.concurrent.Future;
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
CPU Family: 0x6
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
CPU Family: 0x6
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
CPU Family: 0x6