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 arr = [1, 2, 3, 4, 5]; | |
var index = 0; | |
function sendRequest(){ | |
return new Promise( function(resolve, reject){ | |
index++; | |
console.log(arr[index], index); |
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
const bg = { | |
devMode : BGJOBFINDER.devMode === 'dev'? true : false, | |
type: 'log', | |
log(...params){ | |
this.common(...params); | |
}, | |
info( ...params ){ |
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 myFunction(x) { | |
if (x.matches) { // If media query matches | |
document.body.style.backgroundColor = "yellow"; | |
console.log('one time only'); | |
} else { | |
document.body.style.backgroundColor = "pink"; | |
console.log('pink'); | |
} | |
} |
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
@-webkit-keyframes placeHolderShimmer{ | |
0%{ | |
background-position: -468px 0 | |
} | |
100%{ | |
background-position: 468px 0 | |
} | |
} | |
@keyframes placeHolderShimmer{ | |
0%{ |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
getNameNRenderElement() { | |
( () => { | |
let nameList = {}, | |
returnObj = {}; | |
return (args => { | |
if (Object.keys(nameList).length > 0) { | |
console.log(returnObj, 'return form momize'); |
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
export const getRandomId = () => { | |
let random = function () { | |
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); | |
}; | |
return (random() + random() + "-" + random() + "-" + random() + "-" + random() + "-" + random() + random() + random()); | |
}; |
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
/****************************** | |
* Arry unique | |
****************************** */ | |
function arrUnique(arr){ | |
let len = arr.length; | |
let newArr = []; | |
for( let i=0; i < len; i++ ){ | |
if( newArr.indexOf(arr[i]) === -1){ | |
newArr.push(arr[i]); | |
} |
NewerOlder