Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicholas Jackson nicholasjackson827

View GitHub Profile
View MagicGumball.ps1
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) {
View AlphanumericIdUtil.java
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));
}
/**
View Microsoft.PowerShell_profile.ps1
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 '^[^:]+::', ''