A collection of commands that change the Arc Browser icon on macOS.
| Theme | Command |
|---|---|
| Candy Arc | defaults write company.thebrowser.Browser currentAppIconName candy |
Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:
project-root/
├── cmd/
│ ├── your-app-name/
│ │ ├── main.go # Application entry point
│ │ └── ... # Other application-specific files| def program(): | |
| from itertools import zip_longest | |
| import zlib | |
| import subprocess | |
| class Display: | |
| def __repr__(self) -> str: | |
| subprocess.run([ | |
| "feh", | |
| "-xYFqZ", |
| # This script automatically handles Syncthing conflicts on text files by applying a | |
| # git three-way merge between the previously synced version and each divergent version. | |
| # It depends on the watchdog package and git. | |
| # For automatic dependency installation when running with ´uv run --script deconflicter.py´: | |
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [ | |
| # "watchdog", |
| <# | |
| .SYNOPSIS | |
| Installs Syncthing as a Windows service | |
| .DESCRIPTION | |
| Uses NSSM (Non-Sucking Service Manager) to set up Syncthing as a Windows | |
| service. Requires both Syncthing and NSSM to already be installed. nssm.exe | |
| must be available via the PATH environment variable. | |
| .PARAMETER InstallDir |
| <# | |
| Prerequisites: PowerShell v3+ | |
| License: MIT | |
| Author: Michael Klement <mklement0@gmail.com> | |
| DOWNLOAD and DEFINITION OF THE FUNCTION: | |
| irm https://gist.github.com/mklement0/f726dee9f0d3d444bf58cb81fda57884/raw/Enter-AdminPSSession.ps1 | iex |
Ctrl + Alt + Space
| #!/usr/bin/env python | |
| # Before you run this script make sure Flask-SQLAlchemy is installed in | |
| # your virtual environment | |
| from flask import Flask | |
| from flask_sqlalchemy import SQLAlchemy | |
| app = Flask(__name__) | |
| app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' # in-memory |
| # https://play.golang.org/p/JxqibtHkuO- | |
| func chunkBy(items []string, chunkSize int) (chunks [][]string) { | |
| for chunkSize < len(items) { | |
| items, chunks = items[chunkSize:], append(chunks, items[0:chunkSize:chunkSize]) | |
| } | |
| return append(chunks, items) | |
| } |
In the other file of this gist I detail why we should use struct{} as context.Value() keys and not int or string. Open gist to see main.go but the TLDR is:
type key struct{}
ctx = context.WithValue(ctx, key{}, "my value") // Set value
myValue, ok := ctx.Value(key{}).(string) // Get value