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
version: '3.5' | |
services: | |
postgres: | |
container_name: postgres_container | |
image: postgres:alpine | |
environment: | |
POSTGRES_USER: ${POSTGRES_USER:-postgres} | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} | |
PGDATA: /data/postgres |
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
# be sure to make a docker netwrok named nginx-proxy | |
version: "3" | |
services: | |
app: | |
image: 'jc21/nginx-proxy-manager:latest' | |
restart: unless-stopped | |
expose: | |
- 81 | |
ports: | |
- '80:80' # Public HTTP Port |
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
## | |
# docker-compose up [-d] | |
# docker-compose down | |
# docker network create nginx-proxy | |
## | |
version: '3.5' | |
networks: | |
inception-net: | |
nginx-proxy: | |
name: nginx-proxy |
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
// Name: change DNS mac | |
import "@johnlindquist/kit"; | |
// Define the DNS servers you want to set | |
const dnsServer1 = "185.51.200.2"; | |
const dnsServer2 = "178.22.122.100"; | |
// Function to change DNS settings | |
async function changeDNS() { |
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
revision = require("child_process") | |
.execSync("git rev-parse HEAD") | |
.toString() | |
.trim(); |
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 { atom } from "jotai"; | |
const strAtom = atom(""); // primitive string atom | |
export function atomWithBroadcast<Value>(key: string, initialValue: Value) { | |
const channel = new BroadcastChannel(key); | |
const baseAtom = atom(initialValue); | |
const listeners = new Set<(event: MessageEvent<any>) => void>(); | |
const broadcastAtom = atom< |
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage |
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
Set-Item -Path Function:prompt -Value $Prompt -Force | |
# get all themes | |
$themes = Get-ChildItem -Path "~\AppData\Local\Programs\oh-my-posh\themes\*" -Include '*.omp.json' | Sort-Object Name | |
# get a rendom theme | |
$theme = Get-Random -InputObject $themes.Name | |
# initiate ohmyposh | |
oh-my-posh --init --shell pwsh --config ~/AppData/Local/Programs/oh-my-posh/themes/$theme | Invoke-Expression | |
# these are for auto complete of commands previously used | |
Import-Module PSReadLine | |
Set-PSReadLineOption -PredictionSource History |
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
// String utils | |
// | |
// resources: | |
// -- mout, https://github.com/mout/mout/tree/master/src/string | |
/** | |
* "Safer" String.toLowerCase() | |
*/ | |
function lowerCase(str) { | |
return str.toLowerCase(); |
NewerOlder