This file contains 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
// JS Code | |
// Libraries used to run slick carousel | |
// 1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js | |
// 2. https://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js | |
const link1 = document.createElement('link'); | |
link1.rel = 'stylesheet'; | |
link1.type = 'text/css'; | |
link1.href = 'https://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.css'; |
This file contains 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
{"lastUpload":"2020-05-19T15:19:10.024Z","extensionVersion":"v3.4.3"} |
This file contains 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
// Fibonacci Function ( Recursion Case) (Very bad time complexity , very slow , the browser crash if you inter index of 50) | |
function fibonacci(position) { | |
if (position < 3) { | |
return 1; | |
} else { | |
return fibonacci(position - 1) + fibonacci(position - 2); | |
} | |
} | |
fibonacci(6); |
This file contains 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
- Create a new folder "styles" inside "src" folder | |
- create 2 folders inside styles "scss" & "css" | |
- move all the files of the starter project inside "scss" and rename their extension to be .scss | |
- edit "index.js" to get the correct url for the index.css file | |
- remove "App.css" from "App.js" file | |
- edit package.json "scripts" object | |
"build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/styles/scss/index.scss -o src/styles/css/", | |
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/styles/scss/index.scss -o src/styles/css/ --watch --recursive", | |
"start-js": "react-scripts start", | |
"start": "npm-run-all -p watch-css start-js", |
This file contains 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://elliotekj.com/2016/11/05/jquery-to-pure-js-event-listeners-on-dynamically-created-elements/ |
This file contains 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
-- Git -- | |
Learn Enough Git to Be Dangerous: https://www.learnenough.com/git-tutorial |
This file contains 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
if(~x.indexOf('a')){alert('found it ')}else{alert('bad luck mate :( ')}; | |
use ~ instead of relying on the result of indexOf if it -1 or not to tell if this string have the search item or not | |
where x is a string |
This file contains 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
--> First in terminal, navigate to your project folder and run the following command: | |
$ npm install browser-sync gulp --save-dev | |
--> then open gulp.js and copy the following : | |
gulp.task('default', ['sass'], function() { | |
gulp.watch(['scss/**/*.scss'], ['sass']); | |
}); | |
var gulp = require('gulp'); | |
var $ = require('gulp-load-plugins')(); |
This file contains 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
$ npm install.... | |
//an error occured | |
> [email protected] postinstall /Applications/XAMPP/xamppfiles/htdocs/myproject/wp-content/themes/Foundationpress | |
> bower install && gulp build | |
module.js:474 | |
throw err; | |
^ | |
Error: Cannot find module 'internal/fs' |