Skip to content

Instantly share code, notes, and snippets.

@iacchus
iacchus / zbell.sh
Created November 24, 2023 10:49 — forked from jpouellet/zbell.sh
Makes Zsh print a bell when long-running commands finish. I use this in combination with i3 and throw big compile jobs (or whatever it may be) into another workspace to get a nice visual notification (workspace indicator turns red) when it's done so I don't need to waste time regularly checking on it.
#!/usr/bin/env zsh
# This script prints a bell character when a command finishes
# if it has been running for longer than $zbell_duration seconds.
# If there are programs that you know run long that you don't
# want to bell after, then add them to $zbell_ignore.
#
# This script uses only zsh builtins so its fast, there's no needless
# forking, and its only dependency is zsh and its standard modules
#
@iacchus
iacchus / termux-keys-tab
Created June 21, 2023 17:06
Termux keyboard
## Configuration with additional popup keys (swipe up from an extra key)
extra-keys = [[ \
{key: KEYBOARD, popup: {macro: "CTRL d", display: exit}}, \
{key: ESC, popup: {macro: "CTRL f d", display: "tmux exit"}}, \
{key: CTRL, popup: {macro: "CTRL f BKSP", display: "tmux ←"}}, \
{key: ALT, popup: {macro: "CTRL f TAB", display: "tmux →"}}, \
{macro: "ALT c", display: "cd", popup: {macro: "ALT g", display: A-g}}, \
{macro: "vim SPACE $(fzf) ENTER", display: "vim", popup: {macro: "ALT g", display: A-g}}, \
{macro: "ESC :w ENTER", display: ":w", popup: {macro: "ALT g", display: A-g}}, \
{macro: "ESC :q ENTER", display: ":q", popup: {macro: "ALT g", display: A-g}}, \
# https://wiki.archlinux.org/title/android
# Command-Line Tools - https://developer.android.com/studio/releases/cmdline-tools
export PATH="~/Android/Sdk/tools/bin/:$PATH"
# SDK Build-Tools - https://developer.android.com/studio/releases/build-tools
export PATH="~/Sdk/build-tools/30.0.3/:$PATH"
# SDK Platform-Tools - https://developer.android.com/studio/releases/platform-tools
export PATH="~/Sdk/platform-tools/:$PATH"
@iacchus
iacchus / apache-vite-docker.conf
Created July 22, 2022 06:28
Vite with Apache Reverse Proxy Inside Docker Fully functional
# you don't need to change anything in the default `vite.config.js`, only proxy / for the web and for the websockets.
<VirtualHost *:80>
ServerName my.site.org
ServerAdmin webmaster@localhost
RewriteEngine on
RewriteCond %{SERVER_NAME} =my.site.org
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
@iacchus
iacchus / run-toggle.sh
Created June 23, 2022 04:31
Shell script that toggles a program on/off
#!/usr/bin/env zsh
# USAGE:
# $ chmod + x run-toggle.sh
# ./run-toggle.sh <program binary path>
export FULL_COMMAND=${@:1}
export PROGRAM_NAME=$1
export PROGRAM_PID=$(pgrep -u $USER -x $PROGRAM_NAME)
@iacchus
iacchus / google-gloud-translate-xliff.py
Last active June 22, 2022 07:44
How to use Google Cloud Translation API to translate XLIFF file in Python (example)
#!/usr/bin/env python3
# USING
#
# This script is an example; for more information, inspect the classes
# translate.storage.xliff.xlifffilename and
# translate.storage.xliff.xliffunit from the lib Translate Toolkit:
#
# https://docs.translatehouse.org/_/downloads/translate-toolkit/en/stable-1.12.0/pdf/
#
@iacchus
iacchus / wide-github.css
Created November 6, 2021 12:55
CSS style Wide Github
/* CSS edited from firefox addon https://addons.mozilla.org/en-US/firefox/addon/widegithub/ */
body #js-repo-pjax-container .repository-content .discussion-timeline,
body .repository-content .capped-card-content {
width: 100% !important;
}
body .application-main .container {
margin-left: 0 !important;
min-width: 980px;
@iacchus
iacchus / install-arch.md
Created October 15, 2021 04:28 — forked from mjnaderi/install-arch.md
Install Arch Linux with Full Disk Encryption (LVM on LUKS)
// see it here:
// https://stackoverflow.com/questions/7563169/detect-which-word-has-been-clicked-on-within-a-text
// https://jsbin.com/oXetAcI/4/edit?html,js,output
$.fn.OneClickSelect = function(){
return $(this).on('click',function(){
var range, selection;
if (window.getSelection) {
selection = window.getSelection();
@iacchus
iacchus / tmux.conf
Created July 1, 2021 01:34 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000