Skip to content

Instantly share code, notes, and snippets.

View nautilytics's full-sized avatar

Nautilytics nautilytics

View GitHub Profile
@nautilytics
nautilytics / README.md
Last active September 21, 2021 22:02
Data Sample - Percent Positivity JSON Structure

Proposed JSON Structure for Multiple Percent Positivity Approach UI

Notes

  • If values array is empty then we don't plot the small multiple chart
  • There should be only 1 selected = true approach for each state and that approach will be used in place of MAP_PERCENT_POSITIVE for the Map.
  • The selected=true approach will also be highlighted with a gold rectangle in the new UI percent positivity view.
@nautilytics
nautilytics / Accordion.tsx
Last active August 9, 2021 21:04
Base Web Accordion with Panel Example
import * as React from 'react';
import {
StatelessAccordion,
} from 'baseui/accordion';
import type {
StatelessAccordionProps,
} from 'baseui/accordion';
export function Accordion(props: StatelessAccordionProps): JSX.Element {
const {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nautilytics
nautilytics / WU-locations-in-DO.geojson
Last active June 17, 2021 22:19
Dominican Republic WU Locations
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

SVG Rendering Bug with Safari and html2canvas

Summary

There is a rendering bug when trying to take a screenshot of an SVG element when using Safari and html2canvas.

See below for example screenshots using html2canvas. As you can see below when fill is an attribute of the svg:path element it is rendered correctly, but when fill is defined as a style it does not render correctly.

@nautilytics
nautilytics / index.tsx
Created May 12, 2021 18:56
Passing in a custom property to a `styled` component and including `$theme`
interface StyledProps {
readonly active: boolean;
}
const DateInput = styled<StyledProps, 'div'>('div', ({
$theme,
active,
}) => ({
borderRadius: '2px',
background: '#EDEDED',
width: '75px',
@nautilytics
nautilytics / index-wo-name.js
Last active April 13, 2021 18:54
Parse an XML file for Welcome Messages
const tx = `
./commonstrings/src/main/res/values-fil/strings.xml: <string name="onboard_location_greeting_noname">Maligayang pagdating!</string>
./commonstrings/src/main/res/values-es-rES/strings.xml: <string name="onboard_location_greeting_noname">¡Te damos la bienvenida!</string>
./commonstrings/src/main/res/values-ro/strings.xml: <string name="onboard_location_greeting_noname">Bine ai venit!</string>
./commonstrings/src/main/res/values-ru/strings.xml: <string name="onboard_location_greeting_noname">Добро пожаловать!</string>
./commonstrings/src/main/res/values-hy-rAM/strings.xml: <string name="onboard_location_greeting_noname">Բարի գալուստ:</string>
./commonstrings/src/main/res/values-zh-rTW/strings.xml: <string name="onboard_location_greeting_noname">歡迎!</string>
./commonstrings/src/main/res/values-it/strings.xml: <string name="onboard_location_greeting_noname">Ti diamo il benvenuto!</string>
./commonstrings/src/main/res/values-zh-rCN/strings.xml: <string name="onboard_location_gre
@nautilytics
nautilytics / index.sql
Created February 11, 2021 16:24
Create a GeoJSON of the Differences of the Countries Surrounding the Disputed India Boundary
COPY
(
SELECT row_to_json(fc) AS json_out
FROM (
SELECT 'FeatureCollection' AS type,
array_to_json(array_agg(f)) AS features
FROM (
SELECT 'Feature' AS type,
st_asgeojson(ST_Intersection(st_transform(a.geom, 4326), st_transform(b.geom, 4326)))::json AS geometry,
ROW_TO_JSON(
@nautilytics
nautilytics / index.sql
Created February 11, 2021 16:13
Create a GeoJSON of the Countries Surrounding the Disputed India Boundary
COPY
(
SELECT row_to_json(fc) AS json_out
FROM (
SELECT 'FeatureCollection' AS type,
array_to_json(array_agg(f)) AS features
FROM (
SELECT 'Feature' AS type,
st_asgeojson(st_transform(st_union(b.geom), 4326))::json AS geometry,
ROW_TO_JSON(
@nautilytics
nautilytics / index.sql
Created February 11, 2021 16:09
Create a GeoJSON of the disputed India Boundaries
COPY
(
SELECT row_to_json(fc) AS json_out
FROM (
SELECT 'FeatureCollection' AS type,
array_to_json(array_agg(f)) AS features
FROM (
SELECT 'Feature' AS type,
st_asgeojson(st_transform(st_union(geom), 4326))::json AS geometry
FROM india_boundary