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
<?php | |
/** | |
* Form Class | |
* | |
* Responsible for building forms | |
* | |
* @param array $elements renderable array containing form elements | |
* | |
* @return void |
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
<?php | |
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
/** | |
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE. | |
* IE10 and up does not support conditional comments in standards mode. | |
* | |
* @uses wp_style_add_data() WordPress function to add the conditional data. | |
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/ |
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
/** | |
* Class to handle batch set to docs maximum 500 per commit | |
*/ | |
class BatchSetHandler { | |
/** | |
* Construct BatchSetHandler object | |
* @param {firebase.firestore.WriteBatch} dbBatch | |
* @param {function} commitCallback Callback after commit promise is resolved. | |
*/ |
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
$tpl = <<<JS | |
// region BlkTitle | |
CaxtonBlock( { | |
id: 'woobuilder-blocks/BlkID', | |
title: 'BlkTitle', | |
icon: 'layout', | |
category: 'woobuilder', |
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
/* Distracting top tabs */ | |
a[aria-label="Watch"], a[aria-label="Marketplace"], a[aria-label="Groups"], a[aria-label="Gaming"] { | |
/* Make invisible */ | |
opacity: 0; | |
} | |
/* Distracting top tabs on hover (mouseover) */ | |
a[aria-label="Watch"]:hover, a[aria-label="Marketplace"]:hover, a[aria-label="Groups"]:hover, a[aria-label="Gaming"]:hover { | |
/* Slightly visible on hover */ | |
opacity: .5; |
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
async function addDataToDB() { | |
try { | |
// Destructive operation do only when needed | |
// await sequelize.sync( {force: true} ); | |
await Vehicle.create( { | |
type: 'car', | |
carPlateNo: 'SA882' | |
} ); |
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
// region Setup database client | |
const { MongoClient } = require( 'mongodb' ); | |
// Server to connect to | |
const uri = "mongodb://localhost:27017"; | |
const dbServer = new MongoClient( uri ); | |
// endregion Setup database client |
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
<?php | |
/** | |
* Get google reviews | |
* @return array Google reviews data | |
*/ | |
function get_google_reviews(){ | |
// URL to fetch | |
$google_api = 'https://maps.googleapis.com/maps/api/place/details/json?placeid=<your_place_id>&sensor=true&key=<key>'; |
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 asciiToFelt(str) { | |
if ( ! isNaN( str ) ) return '' + str; | |
var arr1 = []; | |
for (var n = 0, l = str.length; n < l; n++) { | |
const hex = Number(str.charCodeAt(n)).toString(16); | |
arr1.push(hex); | |
} | |
let hex = arr1.join(""); | |
if ( hex %2 ) hex = '0' + hex; | |
return BigInt('0x' + hex).toString(); |