Skip to content

Instantly share code, notes, and snippets.

@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
@iacchus
iacchus / myweechat.md
Created May 12, 2021 21:27 — forked from pascalpoitras/1.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

You need at least WeeChat 3.2-dev

Enable mouse

/mouse enable

@iacchus
iacchus / gist:25cf9c61fd70e0153f78303b713f9b1b
Created May 12, 2021 21:05 — forked from hencjo/gist:0710d51c5ba51e0aeb2d905f1e3a38f3
Xorg: Two keyboards with different keyboard layout.
# Use xinput to find your keyboards.
$ xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=12 [slave pointer (2)]
⎜ ↳ Logitech Performance MX id=14 [slave pointer (2)]
⎜ ↳ E-Signal USB Gaming Keyboard id=16 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
@iacchus
iacchus / two-mouse-or-touchpad-pointers-on-X.md
Last active April 4, 2022 15:05
Using Two Mouse Pointers on X.org

ORIGINAL HERE: https://stackoverflow.com/questions/4012352/linux-dual-mice-multiple-mice-with-multiple-mouse-pointers

I've found a way to do it, but it causes major tearing with Gnome.

  1. Open a terminal and type in xinput (all commands should be done as normal user).
  2. Look at the id of the one of your mice or touchpad.
  3. Then create a new master device with this command xinput create-master "name". (any name of your choice.)
  4. Get the new master "name" numeric id.
  5. Now you just need to reattach one of your mice to the new master xinput reattach "mouse id" "new master id".