Skip to content

Instantly share code, notes, and snippets.

View markub3327's full-sized avatar
🐢
Slowly but surely to the goals.

Martin Kubovčík markub3327

🐢
Slowly but surely to the goals.
  • University of Ss. Cyril and Methodius in Trnava
  • Slovakia
  • X @markub3327
View GitHub Profile
(base) ➜  prog-ml.github.io git:(main) ✗ pip install black[jupyter]
zsh: no matches found: black[jupyter]
(base) ➜  prog-ml.github.io git:(main) ✗ black notebooks/introduction/simpson.ipynb 
Skipping .ipynb files as Jupyter dependencies are not installed.
You can fix this by running ``pip install black[jupyter]``
No Python files are present to be formatted. Nothing to do 😴
(base) ➜  prog-ml.github.io git:(main) ✗ which black
/Users/nipun/miniconda3/bin/black
(base) ➜  prog-ml.github.io git:(main) ✗ pip install 'black[jupyter]'              
@jirihnidek
jirihnidek / sub-sub-command.py
Last active February 17, 2024 14:18
Python example of using argparse sub-parser, sub-commands and sub-sub-commands
"""
Example of using sub-parser, sub-commands and sub-sub-commands :-)
"""
import argparse
def main(args):
"""
Just do something
@teddziuba
teddziuba / osx_extract_hash.py
Last active October 22, 2024 12:50
Extract a Mac OSX Catalina user's password hash as a hashcat-compatible string
#!/usr/bin/env python3
"""
Mac OSX Catalina User Password Hash Extractor
Extracts a user's password hash as a hashcat-compatible string.
Mac OSX Catalina (10.15) uses a salted SHA-512 PBKDF2 for storing user passwords
(hashcat type 7100), and it's saved in an annoying binary-plist-nested-inside-xml-plist
format, so previously reported methods for extracting the hash don't work.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@iwatake2222
iwatake2222 / detection_PC.py
Last active August 27, 2024 10:37
Object detection using MobileNet SSD with tensorflow lite (with and without Edge TPU)
# -*- coding: utf-8 -*-
import cv2
import tensorflow as tf
import numpy as np
# https://www.tensorflow.org/lite/guide/hosted_models
# http://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip
def detect_from_camera():
@meyerjo
meyerjo / iou.py
Last active July 17, 2024 18:01
Python code to compute the intersection of two boundingboxes
def bb_intersection_over_union(boxA, boxB):
# determine the (x, y)-coordinates of the intersection rectangle
xA = max(boxA[0], boxB[0])
yA = max(boxA[1], boxB[1])
xB = min(boxA[2], boxB[2])
yB = min(boxA[3], boxB[3])
# compute the area of intersection rectangle
interArea = abs(max((xB - xA, 0)) * max((yB - yA), 0))
if interArea == 0:
@SHDShim
SHDShim / Helvetica_font_in_matplotlib.md
Last active September 10, 2024 09:16
matplotlib, jupyter notebook, helvetica

How to setup helvetica font in matplotlib

Helvetica is the standard font for scientific plots. However, the default for matplotlib is not helvetica. You can use the following tutorial for making the change.

[Update in 2022/11/11]

Just have the following line in the beginning of a notebook will take care of the problem.

%config InlineBackend.figure_format='svg'
@danijar
danijar / gru.py
Last active July 25, 2021 18:00
Gated Recurrent Unit with Layer norm and Xavier initializer
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
class GRU(tf.contrib.rnn.RNNCell):
@electronut
electronut / ldr.py
Created May 4, 2014 06:14
Display analog data from Arduino using Python (matplotlib animation)
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import sys, serial, argparse