Skip to content

Instantly share code, notes, and snippets.

View DuffleOne's full-sized avatar

Laura DuffleOne

View GitHub Profile

Keybase proof

I hereby claim:

  • I am duffleone on github.
  • I am duffleman (https://keybase.io/duffleman) on keybase.
  • I have a public key ASBhCKb6Maw30yLOyhoQkCo8krGu_gGRWmfsCZ0zTc2_lgo

To claim this, I am signing this object:

apiVersion: v1
kind: Pod
metadata:
name: sandbox3
namespace: default
spec:
hostname: sandbox3
containers:
- name: sandbox3
image: alpine
apiVersion: v1
kind: Pod
metadata:
name: sandbox2
namespace: default
spec:
hostname: sandbox2
containers:
- name: sandbox2
image: alpine
apiVersion: v1
kind: Pod
metadata:
name: sandbox
namespace: default
spec:
hostname: sandbox
containers:
- name: sandbox
image: alpine
{
"service": {
"nat": {
"rule": {
"1000": {
"description": "DNAT for IIS Webserver",
"destination": {
"address": "195.99.88.112",
"port": "80,443"
},
@DuffleOne
DuffleOne / game.py
Created October 9, 2017 23:31
Rock, Paper, Scissors
import random
def tick(humanChoice, computerChoice):
if (humanChoice == computerChoice):
return {
'winner': None,
'hScore': 0,
'cScore': 0,
};
# 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
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
@DuffleOne
DuffleOne / maestro.py
Created October 17, 2015 10:31
Maestro stuff for Charlie
import serial
import pprint
usb = serial.Serial('COM3', 9600, timeout=0);
PololuCmd = chr(0xaa) + chr(0xc)
usb.write(PololuCmd);
pprint.pprint(usb);
usb.close();
@DuffleOne
DuffleOne / ackermann.php
Created June 21, 2015 20:46
25 Minutes and 22 Seconds to run ack(4,1);
<?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;