Skip to content

Instantly share code, notes, and snippets.

Avatar

George Miller Duffleman

View GitHub Profile
View gist:7d21d09d9a72725f0826a09f1d10d4b2
apiVersion: v1
kind: Pod
metadata:
name: sandbox3
namespace: default
spec:
hostname: sandbox3
containers:
- name: sandbox3
image: alpine
View gist:67198cf3e6f86e9a8737a7bec51a6bba
apiVersion: v1
kind: Pod
metadata:
name: sandbox2
namespace: default
spec:
hostname: sandbox2
containers:
- name: sandbox2
image: alpine
View gist:25cc4143525369ba5bac20fe14c0df53
apiVersion: v1
kind: Pod
metadata:
name: sandbox
namespace: default
spec:
hostname: sandbox
containers:
- name: sandbox
image: alpine
View Example Unifi Web Server Config
{
"service": {
"nat": {
"rule": {
"1000": {
"description": "DNAT for IIS Webserver",
"destination": {
"address": "195.99.88.112",
"port": "80,443"
},
@Duffleman
Duffleman / game.py
Created Oct 9, 2017
Rock, Paper, Scissors
View game.py
import random
def tick(humanChoice, computerChoice):
if (humanChoice == computerChoice):
return {
'winner': None,
'hScore': 0,
'cScore': 0,
};
View overtime-commented.py
# Let's make our own "int" function.
# This is because int() can cause the program to crash
def makeInt(strVal):
try: # TRY and execute the following code, be aware it may crash though
return int(strVal) # If it didn't crash, just return the string value as an Integer
except ValueError: # However, if it did crash, AND It crashed because the Value can't be turned into an Integer
return None # Don't actually crash, just return "None"
# "None" is a special key word in Python, it literally means nothing.
# "" is nothing by human standards, but to python, "" is a valid string like any other, it's just empty
View overtime.py
def makeInt(strVal):
try:
return int(strVal)
except ValueError:
return None
def main():
print("Welcome, let's find out if you are due overtime for your work")
NoCount = 0
@Duffleman
Duffleman / maestro.py
Created Oct 17, 2015
Maestro stuff for Charlie
View maestro.py
import serial
import pprint
usb = serial.Serial('COM3', 9600, timeout=0);
PololuCmd = chr(0xaa) + chr(0xc)
usb.write(PololuCmd);
pprint.pprint(usb);
usb.close();
@Duffleman
Duffleman / ackermann.php
Created Jun 21, 2015
25 Minutes and 22 Seconds to run ack(4,1);
View ackermann.php
<?php
function ack($m, $n)
{
if (!is_integer($m) or ! is_integer($n)) {
throw new Exception('$m and $n must be integers.');
}
if ($m == 0) {
return $n + 1;
@Duffleman
Duffleman / PushmanSpec.php
Created May 21, 2015
Base spec for Pushman PHP Library
View PushmanSpec.php
<?php
namespace spec\Pushman\PHPLib;
use GuzzleHttp\Client;
use GuzzleHttp\Message\Response;
use GuzzleHttp\Stream\Stream;
use GuzzleHttp\Subscriber\Mock;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
You can’t perform that action at this time.