Skip to content

Instantly share code, notes, and snippets.

View Kamforka's full-sized avatar

Kamforka

  • Switzerland
View GitHub Profile
import argparse
import csv
import datetime as dt
import os
import scapy.all as scapy
def check_outdir(outdir):
if not os.path.exists(outdir):
@Kamforka
Kamforka / gist:f2003df12aa088fa0bbee11bcc9a2e36
Created January 28, 2022 14:07
git branch with color prompt
source /usr/share/bash-completion/completions/git
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
else
@Kamforka
Kamforka / hangman-words.txt
Created February 8, 2022 12:46
simple hangman
Hungary | Budapest
Switzerland | Bern
Germany | Berlin
Austria | Vienna
England | London
Scotland | Edinborough
def check_rows_for_winner(board):
for i in range(3):
row = ""
for j in range(3):
row += board[i][j]
if row == "XXX":
return "X"
if row == "OOO":
return "O"
return None