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 toArr = function (objData) { | |
var arr = []; | |
_.map(objData, function (val, key) { | |
val.id = key; | |
arr.push(val); | |
}); | |
return arr; | |
} |
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 createRef(collectionName) { | |
let result = firestore; | |
function addResult(_result, collDocObj) { | |
let collDocKey = Object.keys(collDocObj)[0]; | |
let collDocVal = Object.values(collDocObj)[0]; | |
return _result.collection(collDocKey).doc(collDocVal); | |
} | |
if (arguments[1]) { |
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 msToTime(duration) { | |
var milliseconds = parseInt((duration%1000)/100) | |
, seconds = parseInt((duration/1000)%60) | |
, minutes = parseInt((duration/(1000*60))%60) | |
, hours = parseInt((duration/(1000*60*60))%24); | |
hours = (hours < 10) ? "0" + hours : hours; | |
minutes = (minutes < 10) ? "0" + minutes : minutes; | |
seconds = (seconds < 10) ? "0" + seconds : seconds; |
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
// basic checking | |
// if (firebase.apps.length === 0) { | |
// firebase.initializeApp({ | |
// // ... firebase config | |
// }) | |
// } | |
// node module | |
// example named file: firebase.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
var printer = (function () { | |
var printerInstance; | |
function create() { | |
var turnedOn = false; | |
var paper = 5; | |
function print() { | |
// underlying printer mechanics |
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
div.unclickable { | |
pointer-events: none; | |
} |
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 logStuff(stuff) { | |
if (typeof stuff === "string") { | |
console.log("type: String"); | |
console.log(stuff); | |
} else if (typeof stuff === "object") { | |
console.log("type: Object"); | |
for (var index in stuff) { | |
console.log(index + ": " + stuff[index]); | |
} | |
} else if (typeof stuff === "array") { |
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
.ir { | |
border:0; | |
font: 0/0 a; | |
text-shadow: none; | |
color: transparent; | |
background-color: transparent; | |
} |
NewerOlder