Description |
Name | Package Id | Version | Source |
---|---|---|---|
7Zip | 7zip.7zip | 19.0.0 | winget |
Altap Salamander | salamander | choco | |
Alt-Tab Terminator | alt-tab-terminator | choco | |
AutoHotkey | Lexikos.AutoHotkey | 1.1.33.02 | winget |
AutoHotkey Store Edition | HaukeGtze.AutoHotkeypoweredbyweatherlights.com | Latest | msstore (via winget) |
Carnac |
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 | |
source /home/project/myenv/bin/activate | |
cd /home/project/server | |
PID=$(ps aux | grep 'uvicorn myapp:app' | grep -v grep | awk {'print $2'} | xargs) | |
if [ "$PID" != "" ] | |
then | |
kill -9 $PID | |
sleep 2 | |
echo "" > nohup.out | |
echo "Restarting FastAPI server" |
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 { useState } from 'react'; | |
// credit: https://usehooks.com/useLocalStorage/ | |
function useLocalStorage(key, initialValue) { | |
const [storedValue, setStoredValue] = useState(() => { | |
try { | |
const item = window.localStorage.getItem(key); | |
return item ? JSON.parse(item) : initialValue; | |
} catch (error) { | |
console.log(error); |
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
# Credit to http://www.iarp.ca/hobby/computing/36-git-committed-and-pushed-to-the-incorrect-branch | |
# Ensure you're in the branch that you commited to by accident. | |
git checkout master | |
# Reset the branch back one commit. | |
git reset --soft HEAD^ | |
# Stash the changes | |
git stash |
This specification is inspired by and supersedes the [AngularJS commit message format][commit-message-format].
We have very precise rules over how our Git commit messages must be formatted. This format leads to easier to read commit history.
Each commit message consists of a header, a body, and a footer.
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(); |
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 subprocess | |
echo = subprocess.Popen(['echo','123'], | |
stdout=subprocess.PIPE, | |
) | |
sudo = subprocess.Popen(['sudo','-S','iptables','-L'], | |
stdin=echo.stdout, | |
stdout=subprocess.PIPE, | |
) |
NewerOlder