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
//első elem | |
document.querySelector('.elements'); | |
//utolsó elem | |
document.querySelector('.elements:last-of-type'); |
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
//child kiválasztása | |
var childEl = document.querySelector('.child-element') | |
//szülő kiválasztása | |
var parentEl = childEl.parentNode; |
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
//lista elem kiválasztása | |
var list = querySelector('.list'); | |
//a lista tartalma és egy kis meglepetés | |
var listItems = list.childNodes; | |
//lista elem kiválasztása | |
var list = querySelector('.list'); | |
//a lista tartalma meglepetés nélkül | |
var listItems = list.children; |
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
// Trolls are attacking your comment section! | |
// A common way to deal with this situation is to remove all of the vowels from the trolls' comments, neutralizing the threat. | |
// Your task is to write a function that takes a string and return a new string with all vowels removed. | |
// For example, the string "This website is for losers LOL!" would become "Ths wbst s fr lsrs LL!". | |
function disemvowel(str) { | |
return str.split(/[aeiou]/i).join(''); | |
} | |
//BEST SOLUTION |
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
function wordWrap (word, columns) { | |
let wordArray = word.split(' '); | |
let lineArray = []; | |
let line = []; | |
let lengthCounter = 0; | |
for(let i = 0; i < wordArray.length; i ++) { | |
lengthCounter += wordArray[i].length; | |
if(lengthCounter > columns) { |
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
gulp.task('css', function () { | |
return gulp | |
//kiindulási hely | |
.src('public/css/style.scss') | |
//Sass átalakítása CSS-é | |
.pipe(sass()) | |
//CSS tömörítése | |
.pipe(minifyCSS()) | |
//CSS fájl átnevezése | |
.pipe(rename({ |
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
gulp.task('critical-css', function() { | |
return critical.generate({ | |
inline: true, | |
base: 'public/', | |
src: 'index.html', | |
css: 'public/build/main.min.css', | |
dest: 'public/build/index.html', | |
height: 1080, | |
width: 1920 | |
}) |
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
gulp.task('js', function() { | |
return gulp.src('public/js/*.js') | |
//függőségek kezelése | |
.pipe(ngAnnotate()) | |
//fájlok egy fájlba | |
.pipe(concat('app.min.js')) | |
//tömörítés | |
.pipe(uglify()) | |
//új fájl helye | |
.pipe(gulp.dest('public/build')); |
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
gulp.task('image', function() { | |
return gulp | |
.src('public/img/*') | |
.pipe(imagemin()) | |
.pipe(gulp.dest('public/build/img')); | |
}); |
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
var jsSource = [ | |
'node_modules/angular/angular.min.js', | |
'node_modules/angular-resource/angular-resource.min.js', | |
'node_modules/angular-route/angular-route.min.js', | |
'public/app/**/*.js', | |
'public/app/app.js' | |
]; | |
gulp.task('js', function() { | |
return gulp |