Skip to content

Instantly share code, notes, and snippets.

View ndgnuh's full-sized avatar

Hùng ndgnuh

View GitHub Profile
@ndgnuh
ndgnuh / requirements.txt
Last active August 8, 2023 05:27
requirements.txt
# Global packages to be installed in home directory
# Desktop apps
gdown
https://github.com/thenaterhood/gscreenshot/archive/refs/tags/v3.4.1.tar.gz
# Installed out of convenience
fastapi
uvicorn
pydantic>=2
lenses
@lrvick
lrvick / github-troll.md
Last active May 3, 2024 16:20
Trolling Github's DMCA repo with their own security flaws.
@efirdc
efirdc / pytorch_connected_components.py
Created June 8, 2020 01:37
Connected components in pytorch
# Demonstration: https://www.youtube.com/watch?v=5AvHrIK-Kjc&feature=youtu.be
# rand_cmap from https://stackoverflow.com/questions/14720331/how-to-generate-random-colors-in-matplotlib
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
from visualizations import rand_cmap
W = H = 64
img = torch.randn(W, H).to(device)
@pantor
pantor / nvidia-driver-realtime.sh
Last active November 8, 2024 02:47
Installing NVIDIA drivers on a realtime Linux (PREEMPT-RT)
# Tested on Ubuntu 16.04 and X11, 2019
# 1. Download NVIDIA driver as a .run file
# 2. Stop X-Server
sudo service lightdm stop
# 3. Blacklist Nouveau driver
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
@Bearbobs
Bearbobs / Awesome Configuration
Last active July 4, 2024 20:20
Awesome Dot Files Config and How to Setup on Ubuntu/POP-OS/Debain and other debian based distro
Config Files Repo : https://github.com/Bearbobs/glorious-awesome-debian
Setps to setup on debain based system as the original author is on arch and It's quite diffrent procedure as compared.
## Awesome and Rofi are quite old in debain repo, Building from Git is required.
Steps to do the same.
## Rofi->
git clone --recursive https://github.com/DaveDavenport/rofi
cd rofi
@Zeinok
Zeinok / wine-breeze-dark-theme.md
Last active November 5, 2024 02:15
Breeze Dark theme for Wine

Made possible with this reddit post.

Install

wine regedit wine-breeze-dark.reg

Uninstall (Reset Wine color scheme)

wine regedit wine-reset-theme.reg

## This script contains following image augementation methods:
# Random Horizontal Flip
# Random Crop
# Random Sized Crop
# Random Rotation
# Gaussian Noise
# Random Grayscale
# Random Lightning
# Random Contrast
# Multiply
@christoph-frick
christoph-frick / Awesome-Fennel.md
Last active October 9, 2024 12:58
Use fennel to write the awesome-wm config

How to write an awesome-wm config with Fennel

Awesome-WM is a X11 window manager, that is configured via Lua. Fennel is a Lisp for Lua. This shows a general setup of how to write your awesome-wm config using fennel directly without the compilation step (which would also work, but is not needed).

General setup

Fetch a recent Fennel version (the

@tarlen5
tarlen5 / calculate_mean_ap.py
Last active November 6, 2024 19:45
Calculate mean Average Precision (mAP) for a set of ground truth and predicted bounding boxes for a set of images.
"""
author: Timothy C. Arlen
date: 28 Feb 2018
Calculate Mean Average Precision (mAP) for a set of bounding boxes corresponding to specific
image Ids. Usage:
> python calculate_mean_ap.py
Will display a plot of precision vs recall curves at 10 distinct IoU thresholds as well as output
@jarvisluong
jarvisluong / nonAccentVietnamese.js
Last active November 14, 2024 05:02
Converting standard Vietnamese Characters to non-accent ones (Chuyển đổi ký tự tiếng Việt sang không dấu). Example: hải -> hai
// This function converts the string to lowercase, then perform the conversion
function toLowerCaseNonAccentVietnamese(str) {
str = str.toLowerCase();
// We can also use this instead of from line 11 to line 17
// str = str.replace(/\u00E0|\u00E1|\u1EA1|\u1EA3|\u00E3|\u00E2|\u1EA7|\u1EA5|\u1EAD|\u1EA9|\u1EAB|\u0103|\u1EB1|\u1EAF|\u1EB7|\u1EB3|\u1EB5/g, "a");
// str = str.replace(/\u00E8|\u00E9|\u1EB9|\u1EBB|\u1EBD|\u00EA|\u1EC1|\u1EBF|\u1EC7|\u1EC3|\u1EC5/g, "e");
// str = str.replace(/\u00EC|\u00ED|\u1ECB|\u1EC9|\u0129/g, "i");
// str = str.replace(/\u00F2|\u00F3|\u1ECD|\u1ECF|\u00F5|\u00F4|\u1ED3|\u1ED1|\u1ED9|\u1ED5|\u1ED7|\u01A1|\u1EDD|\u1EDB|\u1EE3|\u1EDF|\u1EE1/g, "o");
// str = str.replace(/\u00F9|\u00FA|\u1EE5|\u1EE7|\u0169|\u01B0|\u1EEB|\u1EE9|\u1EF1|\u1EED|\u1EEF/g, "u");
// str = str.replace(/\u1EF3|\u00FD|\u1EF5|\u1EF7|\u1EF9/g, "y");