Skip to content

Instantly share code, notes, and snippets.

View qtaped's full-sized avatar
💾

Qntn qtaped

💾
View GitHub Profile
@qtaped
qtaped / backup-tm.sh
Last active January 9, 2024 21:53
backup-tm
#!/bin/sh
# rsync Apple TimeMachine-like backup script by Q.
# thanks to:
# http://habrahabr.ru/post/149059/
# http://www.jan-muennich.de/linux-backups-time-machine-rsyn
#uncomment to use notification
#export DISPLAY=:0
#export XAUTHORITY=/home/qntn/.Xauthority
#export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
@qtaped
qtaped / syncFolders.sh
Last active January 12, 2023 22:04
simple rsync bash script
#!/usr/bin/env bash
# brew install rsync
# SETTINGS
def_src="$HOME" # default source
def_dst="/Path/to/external/drive/folder" # default destination
@qtaped
qtaped / regNumber.js
Created January 9, 2024 21:50
regular expression used to insert a certain character (like a comma) at every group of three digits in a number
// reg: /\B(?=(\d{3})+(?!\d))/g
let number = "1234567890";
let formattedNumber = number.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
console.log(formattedNumber);
// return 1 234 567 890
// "/": Delimiters used to indicate the beginning and end of the regular expression.
@qtaped
qtaped / mountDisk.sh
Last active June 17, 2024 14:18
mountDisk simple script
#!/bin/bash
# SETTINGS
excludeDisks='mmcblk0..|zram.'
defaultDisk=$(lsblk -nro NAME,TYPE | grep -v -E ${excludeDisks} | grep 'part' | head -n 1 | awk '{print $1}')
echo " _ "
echo " _ __ ___ ___ _ _ _ __ | |_ "
echo " | _ _ \ / _ \| | | | _ \| __| "
// Create a new window for the UI
var myWindow = new Window("palette", "applyScale");
// Add a checkbox for resizing stroke width
var resizeStrokeCheckbox = myWindow.add("checkbox", undefined, "Resize Stroke Width");
var mathRoundText = myWindow.add("checkbox", undefined, "Math Round Text Size");
resizeStrokeCheckbox.value = true;
// Add a button to the window
var myButton = myWindow.add("button", undefined, "Adjust Scale");