Skip to content

Instantly share code, notes, and snippets.

@beardicus
beardicus / edgerouter-qos
Last active September 14, 2024 06:31
EdgeRouter Lite QOS Settings
#
# fair-queue based settings for EdgeRouter Lite traffic shaping
#
# download is typically 30 and change. everything can burst to 100%
# of bandwidth, priority rules keep the garbage in check
set traffic-policy shaper download
set traffic-policy shaper download bandwidth 30Mbit
@monteslu
monteslu / gpu.html
Created September 12, 2024 20:35
single page compute shader in webgpu much faster than CPU equivalent.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>WebGPU Compute Shader Example</title>
</head>
<body>
<h1>WebGPU Compute Shader Example</h1>
<p id="output"></p>
<script type="module">
@pooladpoor
pooladpoor / csv to db (with django)
Created September 14, 2024 06:13
این کد را در فایل views.py قرار دهید
def csv_to_db(reqest):
import csv
from .models import Movie
# باز کردن فایل CSV
with open('C:\\Users\pooladpoor\Desktop\imdb_top_1000_edit.csv', mode='r', encoding='utf-8') as file:
# ایجاد یک reader برای خواندن فایل
csv_reader = csv.reader(file)
next(csv_reader)
@iamjonny
iamjonny / disableServices.ps1
Created June 17, 2022 23:10 — forked from juandbc/disableServices.ps1
Script to disable unnecesary Windows services and improve the performance.
#####################################################################################################################
# Script to disable unnecesary Windows services and improve the performance.
#
# This use the command Set-Service, you can check the below link for more information
# https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-service?view=powershell-7
#
# You should check what service you want to disable, like Windows defender, Windows Search
# or Seclogon (necesary for some programs or games).
# Some services were removed in Windows 10.
#####################################################################################################################
@FuzzysTodd
FuzzysTodd / Circle-USDC-FiatTokenV2...@openzeppelin...contracts...math...SafeMath.sol
Created September 14, 2024 06:08
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
/*
██████ ██████ ██████ ██ ██ ██████ ██████ ██████ ██ ██ ██████ ███████ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ █████ ██████ ██ ██ ██ ██ █████ ██ ██ █████ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██████ ██████ ██ ██ ██████ ██████ ██████ ██ ██ ██ ██████ ███████ ████
Find any smart contract, and build your project faster: https://www.cookbook.dev
Twitter: https://twitter.com/cookbook_dev
@Aupajo
Aupajo / gist:4133515
Last active September 14, 2024 06:05
A few of my favourite Git settings
# Colours
git config --global color.status auto
git config --global color.branch auto
git config --global color.diff auto
# Short-hand aliases
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
@BenjaminPoncet
BenjaminPoncet / ffmpeg-wrapper
Last active September 14, 2024 06:05
Synology VideoStation ffmpeg wrapper with DTS, EAC3 and TrueHD support. This project is no longer maintained: Please see the following projects: https://github.com/darknebular/Wrapper_VideoStation/ - https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher
#!/bin/bash
rev="12"
_log(){
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log
}
_log_para(){
echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log
@salrashid123
salrashid123 / tpm_ca.md
Last active September 14, 2024 05:56
Issue CA-signed certificate for TPM public key using (-force_pubkey)
@Huud
Huud / Calculate_Mean_and_std_of_dataset.py
Created July 23, 2020 14:18
How to calculate the mean and standard deviation of an image dataset
# calculate mean and std deviation
from pathlib import Path
import cv2
imageFilesDir = Path(r'C:\your\dataset\dir\here\trainData')
files = list(imageFilesDir.rglob('*.png'))
# Since the std can't be calculated by simply finding it for each image and averaging like
# the mean can be, to get the std we first calculate the overall mean in a first run then
@Pinsplash
Pinsplash / bombtype3.cfg
Created September 7, 2024 13:46
Portal 2: Make all gel conversion gel without modifying maps
ent_fire prop_paint_bomb addoutput "painttype 3"