┌─────┐ ┌─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┐
│ESC │ | F1 │ F2 │ F3 │ F4 | │ F5 │ F6 │ F7 │ F8 │ | F9 │ F10 │ F11 │ F12 │ |PSCR │SLOCK│PAUSE│
└─────┘ └─────┴─────┴─────┴─────┘ └─────┴─────┴─────┴─────┘ └─────┴─────┴─────┴─────┘ └─────┴─────┴─────┘
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬───────────┐ ┌─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┐
│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │BACKSPACE │ |INS │HOME │PGUP │ │NLOCK│ / │ * │ - │
├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬────────┤ ├─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┤
│TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ |DEL |END |PGDN | | 7 | 8 | 9 | |
├────────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴────────┤ └─────┴─────┴─────┘ ├─────┼
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 path from 'path' | |
| import { fileURLToPath } from 'url'; | |
| import * as esbuild from "esbuild"; | |
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | |
| try { | |
| await esbuild.build({ | |
| entryPoints: [path.resolve(__dirname, './server.mjs')], | |
| bundle: true, |
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 | |
| # Mouse wheel scroll jump fix | |
| # | |
| # scenario: scrolling down or up on page using mouse wheel but sometime | |
| # you see small jumps in reverse direction. (you can debug with 'xev' command) | |
| # | |
| # source: https://askubuntu.com/a/1546417/999831 | |
| # | |
| # requirements: |
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
| # Retry the command until its done. | |
| # install: put it in .zshrc or .bashrc | |
| # usage: | |
| # untilok rsync ... | |
| # RETRY_DELAY=2 untilok rsync ... | |
| untilok() { | |
| retrydelay=${RETRY_DELAY:-10} # seconds; override by exporting RETRY_DELAY | |
| while true; do |
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
| # assuming we serving https://site.com/mirror | |
| # put the `.htaccess` and `header.html` inside `mirror` direcotry. | |
| Options +Indexes | |
| IndexOptions FancyIndexing VersionSort HTMLTable SuppressDescription NameWidth=* Charset=UTF-8 | |
| IndexIgnore header.html .htaccess .gitignore README.md *.log .DS_Store | |
| HeaderName /mirror/header.html |
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 | |
| # Query the GNOME proxy mode | |
| MODE=$(gsettings get org.gnome.system.proxy mode | tr -d "'") | |
| if [ "$MODE" = "manual" ]; then | |
| HOST=$(gsettings get org.gnome.system.proxy.http host | tr -d "'") | |
| PORT=$(gsettings get org.gnome.system.proxy.http port) | |
| # Check if host is local |
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
| <?php | |
| /** | |
| * Plugin Name: jfastload - Disable Elementor editor CDN assets | |
| * Description: Loads Elementor assets from local for air-gapped environment | |
| * Version: 1.0.0 | |
| * Plugin URI: https://yourwebsite.com | |
| * Author: Your Name | |
| * License: GPL v2 or later | |
| * Text Domain: jfastload | |
| */ |
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 list of maximized windows (both horizontal and vertical) | |
| wmctrl -l | while read -r id desktop hostname title; do | |
| # Check if window is maximized (both directions) | |
| net_wm_state=$(xprop -id "$id" _NET_WM_STATE 2>/dev/null) | |
| if [[ "$net_wm_state" == *"_NET_WM_STATE_MAXIMIZED_HORZ"* ]] && \ | |
| [[ "$net_wm_state" == *"_NET_WM_STATE_MAXIMIZED_VERT"* ]]; then | |
| echo "Processing window: $title ($id)" |
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
| from math import atan2, cos, exp, fabs, hypot, pi, sin, sqrt | |
| from typing import Tuple | |
| lab_type = Tuple[float, float, float] | |
| hex_type = str # e.g: #ff00ff | |
| rgb_type = Tuple[int, int, int] | |
| def hex2rgb(v: hex_type) -> rgb_type: | |
| return int(v[1:3], 16), int(v[3:5], 16), int(v[5:7], 16) |
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 | |
| export PGPASSWORD="postgres" | |
| DB_USER="postgres" | |
| DB_NAME="postgres" | |
| DB_HOST="localhost" | |
| DB_PORT="5432" | |
| exec_sql() { | |
| local sql_command="$1" |
NewerOlder