Skip to content

Instantly share code, notes, and snippets.

View nicholasjackson827's full-sized avatar

Nicholas Jackson nicholasjackson827

View GitHub Profile
@nicholasjackson827
nicholasjackson827 / MagicGumball.ps1
Created February 14, 2022 04:17
Magic Gumball Simulation
function Get-StatisticsResults {
$NumberOfQuarters = 10;
$PercentageOfGettingQuarterBack = 0.5;
$NumberOfGumballs = 0;
while ($NumberOfQuarters -ne 0) {
$NumberOfGumballs++;
$RandNumber = (Get-Random -Minimum 0.0 -Maximum 1.0)
if ($RandNumber -lt $PercentageOfGettingQuarterBack) {
@nicholasjackson827
nicholasjackson827 / AlphanumericIdUtil.java
Created July 9, 2018 23:24
Sequential Alphanumeric IDs
public class AlphanumericIdUtil {
private static final String VALID_CHARACTERS = "23456789abcdefghjkmnpqrstuvwxyz";
public static void main(String[] args) {
System.out.println(getNumberFromId("a8e2fz"));
System.out.println(getIdFromNumber(24));
}
/**
@nicholasjackson827
nicholasjackson827 / Microsoft.PowerShell_profile.ps1
Created March 28, 2018 01:56
My Sample PowerShell Profile
Import-Module posh-git
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding(850)
function prompt {
# Get the current path, but format it a bit differently
$CurrentPath = (pwd).Path
$ShortPath = $CurrentPath.Replace($HOME, '~').Replace("\", "/")
$ShortPath = $ShortPath -Replace '^[^:]+::', ''