Skip to content

Instantly share code, notes, and snippets.

View JohannesHa's full-sized avatar

Johannes Hagemann JohannesHa

View GitHub Profile
@JohannesHa
JohannesHa / tictactoe.py
Created September 1, 2021 23:06
TicTacToe Game Generated by OpenAI Codex
# Define a python function which is a very compact tic-tac-toe game.
# Display playing field using pygame library.
import pygame
import time
pygame.init()
class TicTacToe:
@JohannesHa
JohannesHa / addTranslation.py
Last active May 14, 2021 17:15
script for adding a translation for fluentcards kindle to anki flashcards service
import csv
from googletrans import Translator
pathToFluentcardsFile = "DOWNLOADED_TSV_FILE_FROM_FLUENTCARDS"
destinationLanguage = "de"
translator = Translator()
with open(pathToFluentcardsFile, 'r') as file:
rd = csv.reader(file, delimiter="\t", quotechar='"')
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
// Determine who sent the URL.
_ = options[.sourceApplication]
let alertController = UIAlertController(title: "Got You!", message: "You clicked the url: \(url)", preferredStyle: .alert)
let okAction = UIAlertAction(title: "Okay!", style: UIAlertAction.Style.default)
alertController.addAction(okAction)
self.window?.rootViewController?.present(alertController, animated: true, completion: nil)
return true

Keybase proof

I hereby claim:

  • I am johannesha on github.
  • I am johannesha (https://keybase.io/johannesha) on keybase.
  • I have a public key ASD0j1pWZrVTXc_549N3L6Z-ZaTeVw7FnGorVSBNEyLCEAo

To claim this, I am signing this object:

0x4aB6189609Bf958b4E977D642146e64B64ee4aDe
https://gist.github.com/JohannesHa/dfad08843f96a60d0f558dfc86fe26ed
@JohannesHa
JohannesHa / gist:9516008b7b9342721c2998b3f2947a04
Created October 30, 2017 11:06
0x4aB6189609Bf958b4E977D642146e64B64ee4aDe
0x4aB6189609Bf958b4E977D642146e64B64ee4aDe
0x4aB6189609Bf958b4E977D642146e64B64ee4aDe
0x77e3Ee46c12756e7Ba2c47ddD43d7dC02A2A3b17