Skip to content

Instantly share code, notes, and snippets.

View f-vdb's full-sized avatar

Frank van den Boom f-vdb

View GitHub Profile
@f-vdb
f-vdb / fritzbox-cert-update.sh
Created October 7, 2017 11:59 — forked from wikrie/fritzbox-cert-update.sh
Fritzbox Fritz!Box AVM SSL Letsencrypt automatically update
#!/bin/bash
# parameters
USERNAME="maybe empty"
PASSWORD="fritzbox-password"
CERTPATH="path to cert eg /etc/letsencrypt/live/domain.tld/"
CERTPASSWORD="cert password if needed"
HOST=http://fritz.box
# make and secure a temporary file
@f-vdb
f-vdb / client.go
Created February 13, 2016 21:20 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@f-vdb
f-vdb / calc.py
Created May 6, 2013 20:46 — forked from ascv/calc.py
"""
exp ::= term | exp + term | exp - term
term ::= factor | factor * term | factor / term
factor ::= number | ( exp )
"""
class Calculator():
def __init__(self, tokens):
self._tokens = tokens
self._current = tokens[0]
@f-vdb
f-vdb / calc.py
Created May 5, 2013 15:28 — forked from ascv/calc.py
"""
exp ::= term | exp + term | exp - term
term ::= factor | factor * term | factor / term
factor ::= number | ( exp )
"""
class Calculator():
def __init__(self, tokens):
self._tokens = tokens
self._current = tokens[0]
@f-vdb
f-vdb / heuristic-fluff.py
Created November 23, 2012 21:32 — forked from gvx/heuristic-fluff.py
Tic Tac Toe minimax implementation. Import-friendly and easy to extend. heuristic-fluff.py is a more elaborate heuristic. See my blog for why it isn't the default.
from tictactoe import *
class FluffHeuristic(Computer):
a = [0, 2, 8, 6]
b = [1, 5, 7, 3]
def play(self, board):
if not self.other.name:
for i in range(9):
x = board.get(i)
if x and x != self: