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 MyForm = Machine({ | |
id: 'my-form', | |
initial: 'isClosed', | |
context: { | |
firstName: '', | |
lastName: '', | |
email: '', | |
phone: '', | |
category: '', | |
message: '', |
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
#customblog .et_pb_column.et_pb_column_1_4:first-child { | |
width: 71%; | |
} | |
#customblog .et_pb_blog_grid .et_pb_post { | |
float: left; | |
margin-right: 1%; | |
max-width: 32%; | |
margin-bottom: 10px; | |
} |
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 net = require('net'); | |
String.prototype.padStart = function(pad, padWith) { | |
return padWith.repeat(pad - this.length) + this; | |
} | |
var server = net.createServer(socket => { | |
var now = new Date(); | |
var YYYY = now.getFullYear().toString().padStart(4, "0"); | |
var MM = JSON.stringify(now.getMonth() + 1).padStart(2, "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
var fs = require('fs'); | |
module.exports = function(dir, ext, callback) { | |
fs.readdir(dir, (error, data) => { | |
if (error) { | |
callback(error); | |
} else { | |
var regex = new RegExp(`\.${ext}$`); | |
callback(null, data.filter(datum => regex.test(datum))); | |
} |
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 getElementsByClassName = function(className) { | |
return getNodesWithClassName(document.childNodes, className); | |
}; | |
var getNodesWithClassName = function(nodes, className) { | |
if (nodes.length === 0) return []; | |
return (hasClassOf(nodes[0], className) ? [nodes[0]] : []) | |
.concat(getNodesWithClassName(nodes[0].childNodes, className)) | |
.concat(getNodesWithClassName([...nodes].slice(1), className)); | |
}; |
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 NUMBER = 'number'; | |
const STRING = 'string'; | |
const OBJECT = 'object'; | |
const BOOLEAN = 'boolean'; | |
var stringifyJSON = function(obj) { | |
switch(typeof obj) { | |
case NUMBER: | |
case BOOLEAN: return `${obj}`; | |
case STRING: return `\"${obj}\"`; |