This file contains hidden or 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 ps | |
| # docker ps -a | |
| # docker ps --all | |
| # docker volume ls | |
| # docker volume ls -f dangling=true | |
| # docker volume ls -q | |
This file contains hidden or 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
| # python3 -m pip install aiosmtpd | |
| python3 -m aiosmtpd -ddd -n | |
| # send.py | |
| import smtplib | |
| from email.message import EmailMessage | |
| smtp = smtplib.SMTP(host='localhost', port=8025) | |
| msg = EmailMessage() |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <link rel="stylesheet" href="styles.css"> | |
| <style> | |
| body { | |
| margin: 200px 200px; | |
| } |
This file contains hidden or 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
| function Get-Games { | |
| # Game installation locations | |
| $gameDirectoryNames = @("Genshin Impact", "Diablo II Resurrected") | |
| return ( | |
| (Get-ChildItem "C:\Program Files (x86)\Steam\steamapps\common") + | |
| (Get-ChildItem "C:\Program Files (x86)\GOG Galaxy\Games") + | |
| (Get-ChildItem "C:\Program Files (x86)\Ubisoft\Ubisoft Game Launcher\games") + | |
| (Get-ChildItem "C:\Program Files" | Where-Object { $gameDirectoryNames.Contains($_.Name) }) + |
This file contains hidden or 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
| Key Combination Code Action | |
| Alt-j multi cursor selection, "SpawnMultiCursor" | |
| // selection | |
| Shift+Up [1;2A] | |
| Shift+Right [1;2C] | |
| Shift+Down [1;2B] | |
| Shift+Left [1;2D] | |
| Shift+Home [1;2H] -- select to start of the line |
This file contains hidden or 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
| // Example 1 - fetch() | |
| function fetchExample() { | |
| appCacheName = 'my-app'; | |
| async function fetchData(url) { | |
| // remove from cache | |
| // const keys = await caches.keys(); | |
| // for (const key of keys) { | |
| // console.log('deleting: ', key) | |
| // caches.delete(key); | |
| // } |
This file contains hidden or 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 -g mouse on | |
| set-option -g default-command bash | |
| set -g default-terminal "screen-256color" |
This file contains hidden or 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
| t2.nano | |
| ### Elastic Beanstalk, Single Instance | |
| # single task | |
| siege \ | |
| --concurrent=10 \ | |
| --reps=100 \ | |
| --header="Authorization: Bearer abc" \ | |
| http://some-ec2-instance.compute-1.amazonaws.com/task/1 |
This file contains hidden or 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
| // https://medium.com/@subwaymatch/disabling-back-button-in-react-with-react-router-v5-34bb316c99d7 | |
| export const usePreventBrowserBack = () => { | |
| const currentPathname = useRef(null); | |
| const currentSearch = useRef(null); | |
| const history = useHistory(); | |
| useEffect(() => { | |
| history.listen((newLocation, action) => { | |
| if (action === "PUSH") { | |
| if ( |
This file contains hidden or 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
| from flask import Flask, jsonify, request, Response, make_response | |
| import requests | |
| # python3 -m venv venv | |
| # . venv/bin/activate | |
| # pip install flask requests | |
| # | |
| # export FLASK_APP=server.py | |
| # export FLASK_ENV=development |
NewerOlder