Skip to content

Instantly share code, notes, and snippets.

View akopcz2's full-sized avatar
👾
workin

akopcz2

👾
workin
View GitHub Profile
let n = document.querySelectorAll('.btn.btn-default.option.agree.min');
let clickFinish = () => {
let nb = document.getElementById('nextbut');
nb.click();
}
let clickSubmit = () => {
let sb = document.getElementById('submbut');
sb.click();
@akopcz2
akopcz2 / mongo-restore
Last active August 15, 2017 21:16
mongo-restore
require('dotenv').config()
let fs = require("fs");
let shell = require('shelljs');
const globby = require('globby');
let path = require('path');
let util = require('util');
//get db from env
let database = process.env.MONGO_URI;
database = database.split('/').pop();
@akopcz2
akopcz2 / mongo-dump
Created August 15, 2017 20:37
mongo dump
require('dotenv').config()
let fs = require("fs");
let shell = require('shelljs');
//get db from env
let database = process.env.MONGO_URI;
database = database.split('/').pop();
init();
var DoublyLinkedList;
function Node(data) {
this.data = data;
this.previous = null;
this.next = null;
}
function DoublyLinkedList() {
@akopcz2
akopcz2 / gist:104b6fcc26d9642f2d0f62c05277093d
Created September 15, 2017 15:56
set timeout within for loop
let canvas = document.getElementById("canvas");
for (let i = 0; i < 1000; i++) {
(function(i) {
setTimeout(
function() {
canvas.click();
},
100 + (50 * i));
})(i);
const mainContainer = document.querySelector('.global-navigation-slideout__container');
mainContainer.addEventListener('transitionend', function handler(event) {
self.indicationElements.masterBrandHeader.classList.remove('scrolled');
event.currentTarget.removeEventListener('transitionend', handler);
}, false );
class MobileNavigation {
constructor() {
this.mobileNavigationElements = {
mobileNavLink: document.querySelectorAll('.global-navigation-slideout-mobile__item')
};
}
attachListener(currentState) {
if(currentState.mobileNavigation) {
for (let element of [...this.mobileNavigationElements.mobileNavLink]) {
element.addEventListener('click', (event) => {
class ShrinkingHeader {
constructor() {
this.header = {
header: document.querySelector('.header'),
headerWrap: document.querySelector('.header-wrap')
};
}
toggleHeader(currentState){
const scrollValue = window.pageYOffset;
.box {
background: lightblue;
width: 200px;
height: 200px;
margin: 20px auto;
transition: transform .3s linear, background-color .6s ease-in-out;
transform-origin: center;
transform-style: preserve-3D;
}
let chunkRecipe = recipe.reduce((ar, it, i) => {
const value = Math.floor(i/this.rateLimit);
if(!ar[value]) {
ar[value] = [];
}
ar[value].push(it);
return ar;
}, [])
this.chunks.push(chunkRecipe);