Skip to content

Instantly share code, notes, and snippets.

@ykiu
ykiu / bing.json
Last active September 22, 2023 08:14
20230922_terriajs_bingmaps_culture
{
"homeCamera": {
"north": -8,
"east": 158,
"south": -45,
"west": 109
},
"catalog": [
{
"type": "bing-maps",
@ykiu
ykiu / migrateFromJssToEmotion.js
Last active November 27, 2021 12:28
A jscodeshift codemod for migrating from makeStyles() API of Material UI v4 to emotion's css props. Assumes the input is in JavaScript (not TypeScript).
function lookupByName(scope, name) {
const path = scope.getBindings()[name]?.[0];
if (path) return path;
if (scope.parent == null) return null;
return lookupByName(scope.parent, name);
}
function getClosestFunctionBody(path) {
if (path.value.type === 'FunctionDeclaration') {
return path.get('body');
function defered() {
const def = {};
def.promise = new Promise((resolve, reject) => {def.resolve = resolve; def.reject = reject;});
return def;
}
function request(url) {
let def = defered();
const req = new XMLHttpRequest();
req.open("GET", "http://localhost:8000/DSC00887.JPG");