Skip to content

Instantly share code, notes, and snippets.

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

Süleyman Gölbol sglbl

🏠
Working from home
View GitHub Profile
@sglbl
sglbl / pyproject.toml
Last active January 8, 2025 15:17
Uv pyproject.toml file for Torch cpu/gpu selection
# This template toml file works with pytorch cpu and gpu versions using 'uv sync --extra cpu' and 'uv sync --extra gpu' commands
[project]
name = "digit-classification"
version = "0.1.0"
description = "Digit classification project"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"gradio==5.6.0",
"matplotlib==3.9.2",
@sglbl
sglbl / setup_template_for_uv.sh
Last active December 16, 2025 09:17
Add project dir for uv
#!/bin/bash
set -e
# Step 0: Check if main.py exists before uv init
MAIN_EXISTS=false
[ -f main.py ] && MAIN_EXISTS=true
# Step 0: Run uv init (it will generate default files)
uv init
@sglbl
sglbl / dir_tree_structure.py
Created August 5, 2024 07:40
Directory Tree Structure
import os
# Show file tree structure in the current directory
def list_file_structure(startpath):
for root, dirs, files in os.walk(startpath):
# Skip directories that start with a dot, __pycache__, and also include .git explicitly
dirs[:] = [d for d in dirs if not (d.startswith('.') or d == '__pycache__')]
level = root.replace(startpath, '', 1).count(os.sep)
indent = ' ' * 4 * (level)
print('{}{}/'.format(indent, os.path.basename(root)))
subindent = ' ' * 4 * (level + 1)
@sglbl
sglbl / settings.sctranslator
Created November 29, 2023 14:36
sctranslator settings
{"afterSelectingTextRegExpList":[],"audioPlaybackRate":1,"audioVolume":100,"autoInsertResult":false,"autoPasteInTheInputBox":false,"autoTranslateAfterInput":true,"autoTranslateWebpageHostList":[],"btnPosition":{"x":5,"y":5},"comparisonCustomization":{"color":"currentcolor","underlineColor":"rgba(144,236,233,1)","underlineStyle":"solid"},"contextMenus":[{"enabled":true,"id":"TRANSLATE_SELECTION_TEXT"},{"enabled":false,"id":"LISTEN_SELECTION_TEXT"},{"enabled":false,"id":"OPEN_SEPARATE_WINDOW"},{"enabled":false,"id":"OPEN_THIS_PAGE_WITH_PDF_VIEWER"},{"enabled":false,"id":"TRANSLATE_CURRENT_PAGE"}],"customTranslateSourceList":[],"customWebpageTranslateSourceList":[],"customizeStyleText":"","defaultAudioSource":"google.com","defaultTranslateFrom":"","defaultTranslateSource":"google.com","defaultTranslateTo":"","displayModeEnhancement":{"oAndT_NonDiscrete":false,"oAndT_Underline":false,"oAndT_hideSameLanguage":false,"oAndT_paragraphWrap":true,"o_Hovering":false,"t_Hovering":false},"displayOfTranslation":{"dict":tru
@sglbl
sglbl / vscode_with_wsl_with_icon.bat
Last active May 28, 2024 07:30
Open WSL with VSCode on Context Menu
:: ######################################- batch file from github.com/sglbl -##############################################
chcp 1254
@echo off
color 04
title Open VSCode with Wsl option in right click context menu
set "VscodeIcon=C:\Program Files\Microsoft VS Code\Code.exe"
:: ########################################################################################################################
set "KeyOfOpeningSpesificFolder=HKCR\Directory\shell\Wsl and VSCode"
REG ADD "%KeyOfOpeningSpesificFolder%" /v "Icon" /t REG_EXPAND_SZ /d "%VscodeIcon%"
REG ADD "%KeyOfOpeningSpesificFolder%" /ve /t REG_EXPAND_SZ /d "Open VSCode with Wsl"
@sglbl
sglbl / asdf.sh
Created November 27, 2023 16:38
Asdf installation
#!/bin/bash
# Install dependencies
sudo apt update
sudo apt install curl git -y
# install python building dependencies
sudo apt install build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev -y
@sglbl
sglbl / markdown_preview_mode.json
Created November 14, 2023 10:22
Open Markdown (MD) files in Preview Mode by Default
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor",
}
@sglbl
sglbl / installChoco
Created June 30, 2022 11:22
Install Choco
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
@sglbl
sglbl / windows11FullContextMenu.bat
Created June 30, 2022 10:31
Full context menu on Win11
REG ADD "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
@sglbl
sglbl / Open_Vscode_with_Wsl.bat
Created June 28, 2022 08:54
Open Vscode with Wsl Batch File
:: ######################################- batch file from github.com/sglbl -##############################################
chcp 1254
@echo off
color 04
title Open VSCode with Wsl option in right click context menu
:: ########################################################################################################################
set "KeyOfOpeningSpesificFolder=HKCR\Directory\shell\Wsl and VSCode"
REG ADD "%KeyOfOpeningSpesificFolder%" /ve /t REG_EXPAND_SZ /d "Open VSCode with Wsl"
REG ADD "%KeyOfOpeningSpesificFolder%\command" /ve /t REG_EXPAND_SZ /d "wsl --cd \"%%V\" code . "