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
// Constants | |
const passphrase = 'A3PnGzWjxGuAYtFu', | |
key = 'data', | |
object = { foo: 'bar' }; | |
// Log original item | |
console.log('Original object', object); | |
// Store item with encryption | |
setItem(key, object, passphrase) |
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
// Constants | |
const passphrase = 'password', | |
key = 'data', | |
object = { foo: 'bar' }; | |
// Log original item | |
console.log('Original object', object); | |
// Store item with encryption | |
setItem(key, object, passphrase); |
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
/** | |
* Traverse object path and optionally update value | |
* @param obj Object to traverse | |
* @param path Object path - | |
* Include array indexes as a regular dot-key notation e.g. `parent.0.key` - | |
* *Doesn't support keys with a . inside* | |
* @param flags Flags object for modifying key value | |
* - `newValue` New value to set the key to | |
* - `deleteValue` If true the key will be deleted from object | |
*/ |
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
import Redis from 'ioredis'; | |
type CallbackFn<T = any, S = any> = ( | |
value: T, | |
key: string, | |
store: S | |
) => void | Promise<void>; | |
interface IRedisHashMap<T = any> { | |
delete(key: string): Promise<number>; |
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
@echo THIS MUST BE RUN WITH WINDOWS POWERSHELL FOR INITIAL CHOCOLATEY INSTALLATION | |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
choco install brave jre8 firefox 7zip vlc notepadplusplus git openssh putty nodejs sysinternals jdk8 chocolatey-windowsupdate.extension vcredist140 netfx-4.7.1-devpack filezilla teamviewer dotnetfx dotnet3.5 vcredist2015 dotnet4.5 python winscp vscode rainmeter sourcetree qbittorrent androidstudio composer goggalaxy gimp irfanview spotify |
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
const { | |
fromEvent, | |
interval, | |
merge | |
} = rxjs | |
const { | |
takeUntil, | |
repeat, | |
throttle, |
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/bash | |
php artisan migrate | |
php artisan key:generate | |
php artisan passport:install |
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
sudo apt update | |
sudo apt upgrade -y | |
sudo apt dist-upgrade -y | |
sudo apt install nginx redis-server curl dirmngr apt-transport-https lsb-release ca-certificates -y | |
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - | |
sudo apt -y install nodejs | |
sudo apt -y install gcc g++ make | |
sudo ufw allow 'Nginx HTTP' | |
sudo apt install mariadb-server -y | |
sudo mysql_secure_installation |
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/bash | |
sudo apt install apt-transport-https curl | |
curl -s https://brave-browser-apt-release.s3.brave.com/brave-core.asc | sudo apt-key --keyring /etc/apt/trusted.gpg.d/brave-browser-release.gpg add - | |
echo "deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main" | sudo tee /etc/apt/sources.list.d/brave-browser-release.list | |
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg |
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
sudo mkdir -p /var/swaps/ | |
sudo dd if=/dev/zero of=/var/swaps/swap.1 bs=1M count=4096 | |
sudo mkswap /var/swaps/swap.1 | |
sudo chmod 600 /var/swaps/swap.1 | |
echo "/var/swaps/swap.1 swap swap defaults 0 0" | sudo tee -a /etc/fstab | |
sudo swapon -a |
NewerOlder