This file contains 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
// 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. |
This file contains 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
#!/usr/bin/env bash | |
# brew install rsync | |
# SETTINGS | |
def_src="$HOME" # default source | |
def_dst="/Path/to/external/drive/folder" # default destination | |
This file contains 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/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 |