A little hack to test isolated HTML template previewing within a <iframe> using Blob - without need for another server request.
This file contains hidden or 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
:root { | |
--main-bg-color: brown; | |
} | |
.one { | |
background-color: var(--main-bg-color); | |
} |
This file contains hidden or 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 getPosition = function (options) { | |
return new Promise(function (resolve, reject) { | |
navigator.geolocation.getCurrentPosition(resolve, reject, options); | |
}); | |
} | |
getPosition() | |
.then((position) => { | |
console.log(position); | |
}) |
This file contains hidden or 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 options = { | |
enableHighAccuracy: true, | |
timeout: 5000, | |
maximumAge: 0 | |
}; | |
function success(pos) { | |
var crd = pos.coords; | |
console.log('Your current position is:'); |
This file contains hidden or 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
npm install --unsafe-perm=true |
This file contains hidden or 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
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
export default class Google extends React.Component { | |
componentDidMount() { | |
if(window) (window.adsbygoogle = window.adsbygoogle || []).push({}); | |
}; | |
render() { | |
return ( |
This file contains hidden or 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 | |
$fp = fopen('results.json', 'w'); | |
fwrite($fp, json_encode($response, JSON_UNESCAPED_UNICODE)); | |
fclose($fp); | |
// or file_put_contents('results.json', json_encode($response, JSON_UNESCAPED_UNICODE)) |
This file contains hidden or 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 | |
$json = json_decode(file_get_contents($file), true); |