Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Zanco dangpzanco

  • Florianópolis, Brasil
View GitHub Profile
@shaypal5
shaypal5 / confusion_matrix_pretty_print.py
Last active Apr 27, 2022
Pretty print a confusion matrix with seaborn
View confusion_matrix_pretty_print.py
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14):
"""Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap.
Note that due to returning the created figure object, when this funciton is called in a
notebook the figure willl be printed twice. To prevent this, either append ; to your
function call, or modify the function by commenting out the return expression.
@bogdan-kulynych
bogdan-kulynych / install-cuda-10-bionic.sh
Last active May 16, 2022
Install CUDA 10 on Ubuntu 18.04
View install-cuda-10-bionic.sh
# WARNING: These steps seem to not work anymore!
#!/bin/bash
# Purge existign CUDA first
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
@parkanaur
parkanaur / script.py
Created Mar 20, 2022
Telegram animated stickers helper (GIF -> WEBM; ffmpeg-python)
View script.py
import os
import glob
from pathlib import Path
import ffmpeg
DEFAULT_FPS = 30
DEFAULT_SMART_DURATION_LIMIT = "2.9"
DEFAULT_SPEED_ADJUST_MODE = "smart"
DEFAULT_FALLBACK_PTS = "1.0"
View twitter.sh
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
View CUDA_Compilers.md
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@kennwhite
kennwhite / vpn_psk_bingo.md
Last active Aug 18, 2022
Most VPN Services are Terrible
View vpn_psk_bingo.md

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016