Skip to content

Instantly share code, notes, and snippets.

View JasonWThompson's full-sized avatar
🤔

Jason W. Thompson JasonWThompson

🤔
View GitHub Profile
@JasonWThompson
JasonWThompson / calculate-pi.ps1
Created February 28, 2022 16:42
Calculate Pi
# Quick and dirty program to demonstrate how to calculate PI
# This program written by Jason W. Thompson for his son who complained about using 22/7 to apporoximate PI.
# Jason asked his son to be grateful the teacher allows him to use an approximation because calulating the exact answer will take
# an eternity.
$ADDITION = 1
$SUBTRACTION = 0
$numerator = 4
$denominator = 1
@JasonWThompson
JasonWThompson / Create-ErrorPages.ps1
Created July 16, 2020 15:20
Generate static error pages
# This generates static text documents that simply contain the error number and a short description.
New-Item -ItemType Directory -Name "errors" -ErrorAction Ignore | Out-Null
# Derived from data found at
# https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
@("400 Bad Request",
"401 Unauthorized",
"402 Payment Required",
"403 Forbidden",
"404 Not Found",

Here are the colors:

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
@JasonWThompson
JasonWThompson / PrimitiveArray.java
Created April 11, 2019 13:52
Trying to see if this shows up in github search
class PrimitiveArray
{
// long[]::new
// int[]::new
}
@JasonWThompson
JasonWThompson / Pokemon.java
Created September 16, 2016 21:44
2^5 2016 DAY 2
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Demonstration on the best way to capture engineering impact.
* @author Jason W. Thompson
*/
public final class Pokemon
{
@JasonWThompson
JasonWThompson / POKEMON.BAS
Created September 15, 2016 17:02
2^5 2016 DAY 1
10 REM cerner_2^5_2016
20 PRINT "YOU'VE ENCOUNTERED A WILD ENGINEERING IMPACT!" : PRINT "GO FIRST HAND!"
30 PRINT "1. ATTACK"
40 PRINT "2. THROW POKEBALL"
50 PRINT "3. RUN"
60 GET ACTION$
70 ACTION_INT=ASC(ACTION$)
80 IF ACTION_INT=49 THEN 120 : REM PLAYER PRESSED 1
90 IF ACTION_INT=50 THEN 180 : REM PLAYER PRESSED 2
100 IF ACTION_INT=51 THEN 160 : REM PLAYER PRESSED 3