π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A script to synchronize Jupyter notebooks (.ipynb) and Python scripts (.py). | |
This script scans a specified directory for pairs of .py and .ipynb files | |
with the same base name. It then compares their last modification times | |
and copies the newer onto the older using `jupytext`. | |
This is useful for those who prefer to track Jupyter Notebooks in .py files. | |
Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository | |
$ git ls-files | xargs wc -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"none": { | |
"english_name": "", | |
"native_name": "", | |
"countries": [] | |
}, | |
"aa": { | |
"english_name": "Afar", | |
"native_name": "Qafar af", | |
"countries": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import argparse | |
from PIL import Image | |
import numpy as np | |
def add_transparency(input_path, output_path, threshold=240): | |
""" | |
Add alpha channel to an image based on brightness threshold. | |
Makes pixels with brightness >= threshold transparent. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Base Models (w/ sizes): | |
meta-llama/Llama-3.2-1B | |
Qwen/Qwen2.5-0.5B | |
SpatialLM Models: | |
manycore-research/SpatialLM-Llama-1B | |
manycore-research/SpatialLM-Qwen-0.5B | |
Commands: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shows which processes & users are consuming GPU memory for Nvidia GPUs. | |
echo "User, PID, Used Memory, GPU ID" | |
# Get the GPU processes information | |
nvidia-smi --query-compute-apps=pid,used_memory,gpu_bus_id --format=csv,noheader | while read line | |
do | |
# Extract PID from the line - use cut instead of awk for CSV format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
case $# in | |
0) | |
echo "Usage: $0 {start|stop}" | |
exit 1 | |
;; | |
1) | |
case $1 in | |
start) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dearpygui.dearpygui as dpg | |
import cv2 | |
import numpy as np | |
import time | |
# Constants | |
# SCALE_FACTOR = 1.0 # Scale factor for the video display | |
SCALE_FACTOR = 0.25 # Scale factor for the video display | |
WINDOW_OFFSET = 20 # Offset between windows in pixels |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dearpygui.dearpygui as dpg | |
import numpy as np | |
dpg.create_context() | |
# Create a 100x100 texture with RGBA values [1.0, 0.0, 1.0, 1.0] | |
texture_data = np.ones((100, 100, 4), dtype=np.float32) | |
texture_data[:, :, 1] = 0.0 # Set green channel to 0 | |
texture_data = texture_data.flatten() # Flatten to 1D array for DearPyGUI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \ | |
&& sudo mkdir -p -m 755 /etc/apt/keyrings \ | |
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ | |
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ | |
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ | |
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ | |
&& sudo apt update \ | |
&& sudo apt install gh -y |
NewerOlder