Skip to content

Instantly share code, notes, and snippets.

View chovanecm's full-sized avatar

Martin Chovanec chovanecm

View GitHub Profile
@chovanecm
chovanecm / pidfare.py
Created February 20, 2024 08:38
PID Fare
#
# Testovací cesty jsou nadefinované od řádku 18.
# Úplně dole je pak výstup výpočtu
#
from fare import Trip
from fare.calculator.fare_calculator import calculate_best_fare
from fare.fare_rules.pid.tickets import tickets
start_time="10:00";
@chovanecm
chovanecm / ntfs.md
Created September 3, 2023 08:03 — forked from six519/ntfs.md
Read/write NTFS drive on macOS Ventura with Apple silicon processor

Configuring your Mac!

Change security settings

  • Shut down your Mac, then press and hold the power button until "Loading startup options" appear.
  • Select "Options"
  • In the menu on top of the screen, choose "Utilities" -> "Startup Security Utility".
  • Click "Security Policy"
  • Select "Reduced Security" and check "Allow user management of kernel extensions from identified developers".
  • Reboot
@chovanecm
chovanecm / convert-to-heic.sh
Created August 10, 2023 18:27
Convert TIFF to HEIC and fix EXIF data based on JPG
magick mogrify -verbose -format heic -quality 60 *.tif
exiftool -tagsfromfile "${JPG_DIR}/%f.jpg" -ext heic .
@chovanecm
chovanecm / MontyHall.js
Created December 20, 2021 21:45
Simple demonstration of the Monty Hall paradox for my own amusement
class Monty {
constructor() {
this.rightDoor = Math.floor(Math.random()*3);
}
pickDoor() {
this.pickedDoor = Math.floor(Math.random()*3);
}
revealGoat() {
this.revealedDoor = [0,1,2].filter(n => n!=this.rightDoor && n!=this.pickedDoor).reduce((prev, curr) => prev == -1 ? curr : [prev, curr][Math.round(Math.random())], -1);
}
@chovanecm
chovanecm / cnn_mnist_tf_1.8.0.py
Created May 1, 2018 14:04
MNIST with Tensorflow 1.8.0 tutorial / test
# coding: utf-8
# In[1]:
import numpy as np
from sacred.stflow import LogFileWriter
from sacred import Experiment
# In[2]: