Skip to content

Instantly share code, notes, and snippets.

View stanleykerr's full-sized avatar
🎯
Focusing

stanley stanleykerr

🎯
Focusing
View GitHub Profile
@stanleykerr
stanleykerr / ActionBar.java
Created May 1, 2016 09:01
ActionBar util
package xyz.saboteur.spigot.util;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class ActionBar {
package xyz.saboteur.pokemongo;
import java.util.HashMap;
import java.util.Map;
import com.pokegoapi.api.pokemon.PokemonType;
public enum Type {
NORMAL(PokemonType.ROCK, 0.5,
PokemonType.GHOST, 0.5,
@stanleykerr
stanleykerr / CPU.java
Last active September 12, 2017 19:37
lol i'm never gonna finish this
package com.stanley.nesemu;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CPU {
private Rom rom;
private Ram ramObj;
var xor = (a, b) => Boolean(a ^ b);
var one = (a, b) => [a && b, xor(a, b), a || b, !(a && !b)];
var two = (a, b, c) => [!((a && b) && (b || c)), xor(a && b, !(b || c))];
var thr = (a, b, c) => [xor(a, !b), !(xor(a, !b) || c), !c && !(xor(a, !b) || c)];
console.log('1.1', one(false, false));
console.log('1.2', one(false, true));
console.log('1.3', one(true, false));
console.log('1.4', one(true, true));
@stanleykerr
stanleykerr / Assignment 2: Binary stuff.js
Created September 16, 2018 21:00
Assignment 2: Binary stuff
String.prototype.swap = function() { return this.replace(/0/g, 'x').replace(/1/g, '0').replace(/x/g, '1'); };
Usage: "00110011".swap(); // Returns output 11001100
@stanleykerr
stanleykerr / options.js
Last active April 17, 2019 17:24
Load options
const options = jsyaml.load(`
---
style:
container:
background: rgb(236, 240, 241)
padding: 10
borderRadius: 10
weekContainer:
marginTop: 10
borderRadius: 10
var options = {
style: {
container: {
background: 'rgb(236, 240, 241)',
padding: 10,
borderRadius: 10
},
weekContainer: {
marginTop: 10,
borderRadius: 10
<html>
<body>
<div id="container01"></div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react/16.4.0/umd/react.production.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.4.0/umd/react-dom.production.min.js"></script>
<script>
/*!
* MonthSelector v1.0.0
* MIT Licensed
*/
@stanleykerr
stanleykerr / BinarySearchTree.java
Last active November 15, 2022 21:47
TestDome Questions
class Node {
public int value;
public Node left, right;
public Node(int value, Node left, Node right) {
this.value = value;
this.left = left;
this.right = right;
}
}