Skip to content

Instantly share code, notes, and snippets.

@thepaperpilot
thepaperpilot / schema.json
Last active September 26, 2023 20:13
Proposed ZITADEL user schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"displayName",
"email",
"givenName",
"familyName"
],
"properties": {
let validWords = [];
const app = document.querySelector("game-app");
const game = app.$game;
const prompt = (question) => false;
const correctLetters = [];
const correctPositions = [];
function checkWord() {
@thepaperpilot
thepaperpilot / fibonacci.asm
Created February 23, 2016 18:45
Assembly Factorial
.data
promptMessage: .asciiz "Enter num: "
resultMessage: .ascii "\nThe fibonacci is "
theNumber: .word 0
theAnswer: .word 0
.text
.globl main
main:
li $v0, 4
@thepaperpilot
thepaperpilot / Fibonacci.java
Last active February 23, 2016 18:26
Comparing recursive to, uh, not recursive
import java.math.BigInteger;
public class Fibonacci {
public static void main(String[] args) {
System.out.println("Recursive Fibonacci:");
long time;
for (int i = 0; i <= 50; i++) {
time = System.currentTimeMillis();
BigInteger slow = slow(i);
@thepaperpilot
thepaperpilot / out of class activities.tex
Created November 30, 2015 20:38
out of class activities template
\documentclass[a4paper,12pt]{article}
\usepackage{setspace}
\doublespacing
\usepackage[letterpaper,margin=0.75in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{ECS 1100.003}
\chead{Community Service}
@thepaperpilot
thepaperpilot / logic_and_proofs.tex
Created September 30, 2015 21:47
LaTeX files
\documentclass[a4paper,12pt]{article}
% \implies is proper, but I like the look of \to better
% you can comment out this line, and everything will change
\newcommand{\implies}{\to}
% for some reason its not working on iff. Changed manually
\newcommand{\leftrightarrow}{\leftrightarrow}
\usepackage{verbatim}
\usepackage{colortbl}
@thepaperpilot
thepaperpilot / FlowTable.java
Created February 8, 2015 01:17
An extension of the LibGDX Table, that wraps actors added to it, based on the table's current width. Use setSize() before adding any actors.
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Cell;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
/** Like a table, but wraps widgets to new rows once the preferred width has been reached
* @author The Paper Pilot */
public class FlowTable extends Table{
@Override
public <T extends Actor> Cell<T> add (T actor) {
float oldWith = getWidth();
@thepaperpilot
thepaperpilot / Combinations.java
Created August 7, 2014 03:17
Change Combinations Calculator
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
public class Combinations {
public int combinations = 0;
public int amount;
public ArrayList<Integer> denominations;
public static void main(String[] args) { //Example Test
@thepaperpilot
thepaperpilot / Recursive Factorial Function
Last active December 28, 2015 18:59
This is a recursive factorial function with a speed of O(n). It is condensed to 1 line.
public static int factorial(int num) {
return num <= 1 ? 1 : num * factorial(num - 1);
}