Skip to content

Instantly share code, notes, and snippets.

John JFFail

Block or report user

Report or block JFFail

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
JFFail / NumberClass.ps1
Created Apr 30, 2016
Example of how to overload operators with classes in PowerShell.
View NumberClass.ps1
class Number {
[int] $value = 0
Number() {
#Does nothing.
Number([int]$somethingElse) {
$this.value = $somethingElse
JFFail / GarageDoor.cs
Created Apr 26, 2016
Reddit Daily Programmer #260 - Garage Door Opener
View GarageDoor.cs
//Reddit Daily Programmer #260 - Easy
using System;
namespace DoorOpener
class DoorOpener
//Create an enumerated set for my sanity in figuring the state of the door.
enum DoorState { open, closed, opening, closing, stoppedOpening, stoppedClosing, emergencyOpening, openBlocked };
JFFail / change-lightswitch.ps1
Created Mar 2, 2016
Solution To Reddit Daily Programmer #255 - Playing With Light
View change-lightswitch.ps1
#Function for flipping the switches.
function FlipSwitch ($Array,$Position)
$currentBoolean = $Array[$Position]
$newValue = $false
JFFail / state-employee.ps1
Created Feb 16, 2016
Silly script to figure out where state employees will go to lunch based on whether or not it's pay day!
View state-employee.ps1
#Making a class for where state employees go for lunch. This does NOT account for holidays affecting when you get paid.
class StateEmployee
#Base properties.
[string] $firstName = ""
[string] $lastName = ""
[bool] $payDay = $false
#Default empty constructor. Seriously, don't use this.
JFFail / up_arrow.vbs
Created Feb 10, 2016
VBScript for the laziest possible way to continuously re-run your last command in a shell.
View up_arrow.vbs
Option Explicit
Dim objShell
set objShell = CreateObject("WScript.Shell")
While true
objShell.SendKeys "{Up}"
WScript.Sleep 200
objShell.SendKeys "{Enter}"
WScript.Sleep 5000
JFFail / date-dilemma.ps1
Created Dec 17, 2015
Solution To Reddit Daily Programmer #245 Easy - Date Dilemma
View date-dilemma.ps1
#Solution to Reddit Daily Programmer 245 Easy.
#Function to parse from the user's specified format into a standard one.
#Void, dumps to STDOUT.
function ParseDate
param (
JFFail / AbunDef.cs
Created Nov 30, 2015
Solution To Reddit Daily Programmer Easy #243 - Abundant and Deficient Numbers
View AbunDef.cs
using System;
using System.Collections;
//Reddit Daily Programmer Easy Challenge #243 - Abundant and Deficient Numbers
namespace AbunDef
class Program
JFFail / typoglycemia.cs
Created Nov 23, 2015
Reddit Daily Programmer #240 Easy - Typoglycemia
View typoglycemia.cs
using System;
using System.Collections;
using System.IO;
using System.Text.RegularExpressions;
namespace Typoglycemia
class Program
static void Main(string[] args)
JFFail / gameOfThrees.cs
Created Nov 3, 2015
Solution To Reddit Daily Programmer #239 - A Game Of Threes
View gameOfThrees.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GameOfThrees
class Program
JFFail / hack-fallout.ps1
Last active Oct 28, 2015
Intermediate Reddit Daily Programmer 238 - Fallout Hacking Minigame
View hack-fallout.ps1
#Reddit Daily Programmer 238 - Intermediate
#Get the desired difficulty from the user.
$needDifficulty = $true
while($needDifficulty) {
Write-Host "How difficult would you like the game to be?"
$difficulty = Read-Host "Enter a value (1 - 5)"
#Validate the input by making sure it's a number.
You can’t perform that action at this time.