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 gg | |
import gx | |
import math | |
import rand | |
import sokol.audio | |
import os.asset | |
import sokol.sgl | |
const designed_width = 600 | |
const designed_height = 800 |
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
> npx puppeteer browsers install chrome # wrong | |
# example version | |
> npx puppeteer browsers install [email protected] # correct |
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 m from "mithril"; | |
// Auto-import all `.ts` and `.js` files inside `pages/` | |
const modules = import.meta.glob("./pages/**/*.{ts,js}"); | |
import { Layout } from "./layouts/default"; | |
const routes: Record<string, any> = {}; | |
// Define a simple 404 component |
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 os | |
import re | |
import subprocess | |
import sys | |
from pathlib import Path | |
def clone_repo(repo_url, target_path="."): | |
# Define patterns for GitHub, GitLab, and Codeberg URLs | |
# Support both HTTPS and SSH-style URLs | |
patterns = [ |
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 os | |
import random | |
import ctypes | |
# Define the path to the directory containing wallpapers | |
WALLPAPER_DIRECTORY = "D:\\your-wallpaper-collection\\nested-dir\\" | |
def set_wallpaper(image_path): | |
""" | |
Sets the desktop wallpaper using the Windows API. |
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 | |
# Get the application directory from the command line argument | |
APP_DIR="$1" | |
# Set installation path | |
INSTALL_DIR="/opt" # Standard directory for optional apps | |
BIN_PATH="/usr/local/bin" # Path where we symlink the executable | |
# Check if APP_DIR was provided |
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 | |
# Check if the AppImage file path is provided | |
if [ -z "$1" ]; then | |
echo "Error: Please provide the path to the AppImage file as the first argument." | |
exit 1 | |
fi | |
# Path to the AppImage file | |
appimage_path="$1" |
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 | |
# Check if an argument (file or directory) is provided | |
if [ -z "$1" ]; then | |
echo "Usage: sizeof <file_or_directory>" | |
exit 1 | |
fi | |
# Use du to calculate size in bytes, then dynamically adjust for KB, MB, GB, etc. | |
size_in_bytes=$(du -sb "$1" | cut -f1) |
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 | |
# Update package list | |
echo "Updating package list..." | |
sudo apt update | |
# Install PHP | |
echo "Installing PHP..." | |
sudo apt install -y php8.0 |
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 | |
# Function to print a message in a specific format | |
print_message() { | |
echo "--------------------------------------------------" | |
echo "$1" | |
echo "--------------------------------------------------" | |
} | |
# Function to install Homebrew |
NewerOlder