This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "crypto/tls" | |
| "crypto/x509" | |
| "fmt" | |
| "io" | |
| "log" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| 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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: |