Skip to content

Instantly share code, notes, and snippets.

View drakvuf's full-sized avatar

László Horváth drakvuf

  • Szeged, Hungary
  • 11:17 (UTC +02:00)
View GitHub Profile
//első elem
document.querySelector('.elements');
//utolsó elem
document.querySelector('.elements:last-of-type');
//child kiválasztása
var childEl = document.querySelector('.child-element')
//szülő kiválasztása
var parentEl = childEl.parentNode;
//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;
// 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
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) {
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({
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
})
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'));
gulp.task('image', function() {
return gulp
.src('public/img/*')
.pipe(imagemin())
.pipe(gulp.dest('public/build/img'));
});
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