What data types in JS do you know? What data types are mutable? How to solve mutability problem in the code?
var person1 = {name: 'Ana'};
var person2 = person1;
person1.name = 'Julia';
console.log(person1.name);
console.log(person2.name);| // check that event.target is the one that we need | |
| var isNavbarToogle = event.target.path.filter(function(item) { | |
| return (item.classList.contains("navbar-toggle") || item.classList.contains("navbar-header")); | |
| }).length == 2; | |
| // to know when gulp task is end | |
| Gulp.task("name", function () { | |
| console.log('started >>>'); | |
| return ..... | |
| .pipe(Gulp.dest("build")) |
| // http://jquense.github.io/react-widgets/docs/#/datetime-picker | |
| // | |
| // <form> | |
| // [date] [time] | |
| // </form> | |
| // | |
| // Both fields return datetime format: | |
| // To compine them in one | |
| let dateField = "Fri Jun 12 2015 15:08:31 GMT+0200"; |
| *Compilation JS with gulp-browserify* | |
| Case # 0. Any error in NOT included files | |
| Result: no errors by compilation and running | |
| Case # 1. Missed lib on the disk | |
| app.js |
| // Theory | |
| // http://htmlpurifier.org/live/smoketests/xssAttacks.php | |
| // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet | |
| // A full collection of HTML5 related XSS attack vectors: | |
| // https://github.com/cure53/H5SC https://raw.githubusercontent.com/cure53/H5SC/master/vectors.txt | |
| // Short list | |
| <script>alert("XSS: script tag")</script> | |
| <script src="http://hackers-site.powertofly.com"></script> |
| # Set editor | |
| https://help.github.com/articles/associating-text-editors-with-git/ | |
| $ git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" |
Keep fonts optimized
Set should be as minimum as possible
Fallback on smaller fontset / standart fontset on mobile devices
woff2 fonts types for progressive browser (Chrome, Opera, Android)
Converter: https://everythingfonts.com/woff-to-woff2
Ability to compile styles from own build system 👍
How to: https://github.com/Semantic-Org/Semantic-UI-LESS
Ability to store site styles separately from semantic and in own place 👍
Put files wherever you need, but update path to this folder in the theme.config
| // handler for click event | |
| var h1 = $("h6").bind("click", function () { | |
| console.log('click handler'); | |
| }); | |
| // handler for click event with namespace | |
| var h2 = $("h6").bind("click.namespace", function () { | |
| console.log('click handler with namespace'); | |
| }); | |
| // click event result: |
The book i'm reading is from 2010, so i want to keep only things that are important now, in 2015, and add some comments about the current situation with having ES2015 and modern libs in place.
Every time a <script> tag is encountered, the page must stop and wait for the code to download (if external)
and execute before continuing to process the rest of the page.
JavaScript’s tendency to block browser processes, both HTTP requests and UI updates,