start new:
tmux
start new with session name:
tmux new -s myname
| var app = require('express').createServer() | |
| var io = require('socket.io').listen(app); | |
| var fs = require('fs'); | |
| app.listen(8008); | |
| // routing | |
| app.get('/', function (req, res) { | |
| res.sendfile(__dirname + '/chat.html'); | |
| }); |
| ## Delete a remote branch | |
| $ git push origin --delete <branch> # Git version 1.7.0 or newer | |
| $ git push origin :<branch> # Git versions older than 1.7.0 | |
| ## Delete a local branch | |
| $ git branch --delete <branch> | |
| $ git branch -d <branch> # Shorter version | |
| $ git branch -D <branch> # Force delete un-merged branches | |
| ## Delete a local remote-tracking branch |
| # 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 | |
| # I have forked a much more complete cheat sheet, but is complete at the expense of being accessable | |
| # You can find that bigger cheat sheet here https://gist.github.com/fathergoose/3fbc3b5f6c0ba3cbe367b18030b39aba | |
| # things in <angleBrackts> are variables to be replaced for a spcific instance of the command | |
| # Getting Help | |
| man <command> # Read the man(ual) page entry for a given command (detailed help) | |
| <command> --help # This *usually* prints a short summary of a command's options and arguments | |
| # Directories |
Next.js, Nginx with Reverse proxy, SSL certificate
| let isRefreshing = false; | |
| let refreshSubscribers = []; | |
| const instance = axios.create({ | |
| baseURL: Config.API_URL, | |
| }); | |
| instance.interceptors.response.use(response => { | |
| return response; | |
| }, error => { |
| /* ******************************************************************************************* | |
| * PUPPETEER | |
| * https://pptr.dev/ | |
| * ******************************************************************************************* */ | |
| // When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) | |
| // that is guaranteed to work with the API. | |
| npm install puppeteer |