Skip to content

Instantly share code, notes, and snippets.

@wakita
wakita / sudoku.py
Last active May 13, 2024 12:57
SMTソルバーを用いた数独の解
import numpy as np
from z3 import *
# 例題
board_spec = '''
39
1 5
3 5 8
8 9 6
7 2
@gregorypease280
gregorypease280 / zed_venv.sh
Created April 4, 2023 23:30
zed venv config
#Gets the current venv path and creates the pyrightconfig for zed
#activate your venv then run it
cofig_file_name="pyrightconfig.json"
current_venv="${current_venv:-$(basename ${VIRTUAL_ENV})}"
current_venv_path="${current_venv_path:-$(builtin cd ${VIRTUAL_ENV}; pwd)}"
project_path="${project_path:-./}"
config_path="${project_path}${cofig_file_name}"
config_venv="${config_venv:-${current_venv}}"
config_venv_path="${config_venv_path:-${current_venv_path}}"
@MihailCosmin
MihailCosmin / cuda_11.8_installation_on_Ubuntu_22.04
Last active May 13, 2024 12:54 — forked from primus852/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.8 and cuDNN 8.7 installation on Ubuntu 22.04 for PyTorch 2.0.0
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active May 13, 2024 12:54 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"
@Tblue
Tblue / dump-firefox-cookies.py
Last active May 13, 2024 12:54
Firefox Cookie Dumper
#!/usr/bin/env python3
# vim: tw=120
#
########################################################################################################################
#
# Dump cookies from Firefox, as a Netscape Cookie File.
# Version: 1.0.1
#
# Required third-party Python packages:
#
@jboner
jboner / latency.txt
Last active May 13, 2024 12:48
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@rrottmann
rrottmann / dist-upgrade-buster-to-bookworm.sh
Created August 20, 2023 12:29
Dist-Upgrade Debian 10 Buster to Debian 12 Bookworm
# Dist-Upgrade Debian 10 Buster to Debian 12 Bookworm
# Debian 10
apt-get -y update
apt-get -y upgrade
apt-get -y full-upgrade
cat > /etc/apt/sources.list <<"EOF"
deb http://deb.debian.org/debian/ bullseye main
deb-src http://deb.debian.org/debian/ bullseye main
deb http://security.debian.org/debian-security stable-security/updates main
@timonsku
timonsku / disable-folder-discovery.reg
Created March 4, 2024 01:07
Disable Windows folder disovery feature via Registry Key that forces every folder to be a misc folder
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell]
"FolderType"="NotSpecified"
@nelsonuhan
nelsonuhan / inland_mk47_qmk.md
Created October 7, 2023 03:23
Flashing QMK firmware onto the Inland MK-47

Flashing QMK firmware onto the Inland MK-47

2023.10.6

Keyboard

Done on a MacBook Pro (Apple Silicon). This worked for me, your mileage may vary.

Preliminaries