Skip to content

Instantly share code, notes, and snippets.

View stereobooster's full-sized avatar
🇺🇦
stand with Ukraine

stereobooster

🇺🇦
stand with Ukraine
View GitHub Profile
@stereobooster
stereobooster / 0-react-maps.md
Last active August 16, 2023 12:19
React Maps
[Raster tiles][rt] [Vector tiles][vt] GeoJSON virtual-dom offline map quality React component React Native
google maps + + good [4 unsupported][gm-react] [+][gm-native]
leaflet * + [+][ll-vt] + [+/-][ll-offline] depends [+][ll-rect]
d3 * + [+/-][d3-vdom] +/- depends [+][d3-react]
MapboxGL + + depends [+][mb-react] [+][mb-native]
Yandex Maps +
@stereobooster
stereobooster / Gemfile
Last active May 26, 2023 15:00
Sinatra namespace example
# frozen_string_literal: true
source "https://rubygems.org"
gem "sinatra", "~> 1.4"
gem "thin"
gem "sinatra-router"
gem "sinatra-contrib"
<!-- Facebook async loading of JSAPI -->
<div id="fb-root"></div>
<script>
// Facebook async loading.
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
const reducer = (oldState, action) => {
if (typeof action === "function") {
return action(oldState)
} else {
return action;
}
}
// useState is simplified useReducer
const useState = (initialState, init) => {