JS guy video - Chrom dev console
- Insert 'debugger;' into your code.
- Right-click on element, then "Scroll into View"
- Select element, and toggle with 'H'
- HTML - DOM Break Point
- removes node
- changes node
- or anything under the node.
- Shift-click color to change color format.
- Disable cache - so that cache cannot be saved
- Shift mouseover. Red are the files that are called. Green are the files that it was called by.
- Screenshots (camera icon) shows what the user sees.
- Deeper review:
- Queuing:
- Lower priority than critical resources (e.g., images vs js/css)
- Unavailable TCP socks - about to free up
- HTTP1 allows only 6 connections per origin
- Time spent on disk cache entries (typically very fast)
- Stalled/Blocking
- Similiar to Queuing
- Usually the proxy server for negotiation
- Proxy negotiation
- Timestamp of how long proxy negotiations took
- DNS Lookup
- Every new domain requires a full round trip to do the DNS lookup
- Initial Connection / Connecting
- Time it took to establish a connection, including TCP handshake/retries and negotiating a SSL.
- Request Sent / Sending
- Time spent issuing the network request. Typically a fraction of a millisecond.
- Waiting (TTFB)
- Time spent waiting on initial response, also known as Time To First Byte. Captures roundtrip and spend time waiting.
- Content Download / Downloading
- Time spent receiving the response data.
- Queuing:
- Try Network Throttling (3G) to get user experience
- 'Workspace' sources tab. Just drag a folder into 'Sources'.
- Run app as localhost, then create workspace and map files to save.
- In the 'call stack', can right-click on any script that are 3rd party, and can 'Blackbox Script'. That script will not be part of debugging, and won't step into it.
- github.com/wilsonpage/fastdom
- Window.requestAnimationFrame() - saves writing of DOM in batch.
- Check out paint flashing => Hit 'esc' for the console drawer and click on 'Rendering'
- And FPS meter
- While looking at pain flashing, just guess and deleting elements might help.
- CSS: 'will-change: transform' -> Will send to GPU. Works best for 'fixed position' elements.
- Heap Snapshot
- Take 2 snapshots then do a comparison. This will be clear if there are any memory leaks.
- @chromedevtools
- @firefoxdevtools
- @edgedevtools
- @paul_irish
- @addyosmani
- @jkup
- http://jankfree.org
- https://developers.google.com/web/tools/chrome-devtools/
- cat - view file contents
- cat key.pub | pbcopy (puts it into clipboard)
- less - view file contents
- nslookup mnmm.co
- Navigate to the ssh folder:
- cd ~/.ssh
- ssh-keygen -t rsa
- Do NOT leave the name default - change the name to something relevant to the project.
- my_key (use underscore)
- Alway give the PUBLIC KEY, NOT the PRIVATE key. Public keys end with .pub.
Login:
ssh -i ~/.ssh/fem_digitalocean [email protected]
- logging in using the SSH key.- Using your password:
ssh [email protected]
less known_host file
(inside .ssh) shows the places and fingerprints.top
runs activity/process monitor.q
to quit.apt-get install htop
- install prettier version of top.
apt-get update
- update softwareapt-get upgrade
- install the updatesadd $USERNAME
- create a new user. Never run as root. Default:kenny
usermod -aG sudo kenny
- add userkenny
to sudo groupsu kenny
- switch to userkenny
cat /var/log/auth.log
- test for access. Default access should be denied.- If need access use
sudo
. Usesudo!!
to replay the previous command in sudo.
Use the SSH key rather than passwords.
-
cat fem_digitalocean.pub | ssh [email protected] "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
- get the public key
- ssh into the server
- create the .ssh directory
- get the key an put it into authorized keys
-
Disable root login
sudo vi /etc/ssh/sshd_config
PermitRootLogin no
sudo service sshd restart
-
Install nginx
- sudo apt install nginx
- sudo service nginx start
- sudo less /etc/nginx/sites-available/default
-
sudo apt install git
-
sudo apt install nodejs npm
-
nodejs --version
-
sudo ln -s /usr/bin/nodejs /usr/bin/node - symlink nodejs to node
-
node --version
-
sudo mkdir -p /var/www/ - make a web directory if doesn't exist
-
sudo chown -R $USER:$USER /var/www
-
mv Dev-Ops-for-Frontend/ app/
-
cd app/
Install NPM
- npm i - install npm packages from package.json
- node app.js - run the app
sudo vi /etc/nginx/sites-available/default
Modify this block
location / { proxy_pass http://127.0.0.1:3001/; }
Restart nginx: sudo service nginx restart
Start express server: node app.js
Install gulp - npm i -g gulp
It will break - fix permissions
sudo mkdir -p /usr/local/lib/node_modules
https://docs.npmjs.com/getting-started/fixing-npm-permissions
- pwd // /var/www/app
npm i -g forever
forever start app.js
- start app.jsforever stopall
- start all- Log forever -
sudo mkdir -p /var/log/forever
- Change owner to current user -
sudo chown -R $USER /var/log/forever
- Start logging -
forever start app.js >> /var/log/forever/forever.log
sudo tail -f /var/log/auth.log
- Above is cool to watch logging in requests.
Inside package.json "scripts": { "deploy": "gulp build && forever stopall & forever start app.js >> /var/log/forever/forever.log" },
- Run the deploy gulp:
npm run deploy
I installed font 'Operator Mono', but was missing something called 'ligatures', which makes symbols pretty like: == and === and =>, etc.
I had to do couple of things: Create new font using 'Operator Mono' to include 'ligatures' with this: https://github.com/kiliman/operator-mono-lig
Then is VSCode, add this to my settings:
Add "editor.fontLigatures": true
It was a little involved, but took about 30 mins.
Right now, the font looks too bold, b/c the tool uses Medium weight. Trying to figure out if I can use the lighter weight.
I FIGURED IT OUT and forked the project. https://github.com/kennyklee/operator-mono-book-lig