What is a HttpOnly cookie?
HttpOnly is an additional flag included in Set-Cookie HTTP response header. Using the HttpOnly flag when generating a cookie helps mitigate the risk of client side script accessing the protected cookie (if the browser supports it).
References
- https://www.owasp.org/index.php/HttpOnly
What are first-class functions?
A programming language is said to have first-class functions if it supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data strucures.
References
- https://en.wikipedia.org/wiki/First-class_function
What is a Debounce function?
Debounce function returns a function that as long as it continues to be invoked, will not be triggered. The function will be called after it stops being called for N milliseconds.
A debounce is a cousin of the throttle, and they both improve the performance of web applications. A debounce is utilized when you only care about the final state. For example, waiting until a user stops typing to fetch typeahead search results.
// Code from https://davidwalsh.name/javascript-debounce-function
var myEfficientFn = debounce(function() {
// All the taxing stuff you do
}, 250);
window.addEventListener('resize', myEfficientFn); The myEfficientFn will not be called until 250 milliseconds has passed since the last resize event.
References
- https://davidwalsh.name/javascript-debounce-function
- https://levelup.gitconnected.com/debounce-in-javascript-improve-your-applications-performance-5b01855e086
.bash_profile vs .bashrc
.bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.
References
- http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html
How to delete a Git branch both locally and remotely?
To delete the local branch use:
$ git branch -d branch_nameTo delete the remote branch use:
$ git push origin --delete <branch_name>References
- http://stackoverflow.com/questions/2003505/how-to-delete-a-git-branch-both-locally-and-remotely