Skip to content

Instantly share code, notes, and snippets.

View ysdede's full-sized avatar
🏠
Working from home

ysdede

🏠
Working from home
View GitHub Profile
@hantoine
hantoine / download_and_unzip.py
Last active November 22, 2023 06:25
Download and extract a ZIP file in Python
from urllib.request import urlopen
from io import BytesIO
from zipfile import ZipFile
def download_and_unzip(url, extract_to='.'):
http_response = urlopen(url)
zipfile = ZipFile(BytesIO(http_response.read()))
zipfile.extractall(path=extract_to)
@mikaelhg
mikaelhg / cuda-install.md
Last active May 21, 2024 07:48
Proper CUDA and cuDNN installation
date title tags
2020-02-29
Proper CUDA and cuDNN installation
tech

You're here, so you're probably already hurting because of CUDA and cuDNN compatibility, and I won't have to motivate you, or explain why you'd want to have standalone CUDA and cuDNN installations, if you're going to develop using Tensorflow in the long term.

1. Download your CUDA runfile (local) packages

@aditya-malte
aditya-malte / smallberta_pretraining.ipynb
Created February 22, 2020 13:41
smallBERTa_Pretraining.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alankbi
alankbi / detecto_demo_8.py
Created February 14, 2020 17:39
Save and load models from files with Detecto
model.save('model_weights.pth')
# ... Later ...
model = core.Model.load('model_weights.pth', ['alien', 'bat', 'witch'])
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active July 24, 2024 17:10
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@kirinelf
kirinelf / clock.html
Last active July 21, 2024 15:13 — forked from sam0737/clock.html
OBS Studio: A HTML page for showing current date and time in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
@sagnitude
sagnitude / nvidia.md
Last active January 21, 2024 11:40 — forked from cavinsmith/nvidia.md
Nvidia GPUs sorted by CUDA cores

List of desktop Nvidia GPUS ordered by CUDA core count

I created it for those who use Neural Style

Guys, please add your hardware setups, neural-style configs and results in comments!

GPU CUDA cores Memory Processor frequency Memory Bandwidth (GB/sec)
Geforce GTX TITAN Z 5760 12 GB 705 / 876 673
@payne911
payne911 / image_integral.py
Last active June 25, 2020 18:50
Convex test on binary images (Image integral for Pattern Matching)
import cv2 as cv
def integral_test(X): # returns True if X is convex
img_t = np.reshape(X, (28, 28)) # preprocess: reshaping
int_result = cv.integral(img_t.astype(np.uint8)) # calculating the integral-image
patterns_to_test = [block_patterns, big_block_patterns, horizontal_patterns, vertical_patterns,
horizontal_patterns2, vertical_patterns2, bigger_block_patterns, horizontal_patterns3,
vertical_patterns3, bbigger_block_patterns, bbbigger_block_patterns, bbbbigger_block_patterns]
for p in range(len(patterns_to_test)): # run test on all patterns until a match is found
@miabrahams
miabrahams / FfmpegPostprocess.py
Last active March 2, 2024 18:07
Ffmpeg post-processing OBS Plugin
import obspython as obs
import subprocess
import os
import re
import datetime
# Info for potential OBS Python hackers!
# Tip 1 - Read the "OBS Studio Backend Design" documentation page. Read the documentation table of contents.
# Tip 2 - be sure to add obspython.py to your script path to enable completion.
# Tip 3 - Some of the Python API is generated at runtime, so it won't show up in obspython.py.
@Bilka2
Bilka2 / webhook.py
Last active July 19, 2024 10:51
Simple discord webhook with python
import requests # dependency
url = "<your url>" # webhook url, from here: https://i.imgur.com/f9XnAew.png
# for all params, see https://discordapp.com/developers/docs/resources/webhook#execute-webhook
data = {
"content" : "message content",
"username" : "custom username"
}