```mermaid
sequenceDiagram
participant dotcom
participant iframe
participant viewscreen
dotcom->>iframe: loads html w/ iframe url
iframe->>viewscreen: request template
viewscreen->>iframe: html & javascript
iframe->>dotcom: iframe ready
// In TS, interfaces are "open" and can be extended | |
interface Date { | |
/** | |
* Give a more precise return type to the method `toISOString()`: | |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString | |
*/ | |
toISOString(): TDateISO; | |
} | |
type TYear = `${number}${number}${number}${number}`; |
################### | |
# STAGE 1: builder | |
################### | |
FROM --platform=linux/amd64 eclipse-temurin:11.0.12_7-jdk-focal as builder | |
ARG MB_EDITION=oss CI=true | |
WORKDIR /app/ |
// Your domain name | |
const MY_DOMAIN = 'note.example.com' | |
// Website language | |
const LANG = 'en' | |
// Favicon url | |
const FAVICON_URL = 'https://example.com/favicon.ico' | |
// Your config page link |
A typical use-case on web for maintaining React State is your URL's query parameters. It lets users refresh pages & share links without losing their spot in your app.
URL-as-state is especially useful on Next.js, since next/router
will re-render your page with shallow navigation.
This gist lets you leverage the power of URL-as-state, while providing a fallback to React state for usage in React Native apps.
It's essentially a replacement for useState
.
MIT License | |
Copyright (c) 2021 Daniel Ethridge | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
// | |
// CGPath+svg.swift | |
// | |
// Create an SVG element from a CGPath. | |
// | |
// Created by Dave Ceddia. | |
// MIT Licensed | |
// | |
// Inspired by: https://github.com/mro/MROGeometry/blob/master/MROGeometry/CGPathWriter.c |
Modern JavaScript build tools compile entire folder structures of JavaScript code into single, minified files that are near-impossible to read, but can also include source maps which can be used to display the original code in tools such as the Chrome DevTools Sources panel.
These source maps can be processed to extract mainly meaningful code and file structures, by installing a package calling Shuji and running a simple bash command.
Generally, production builds shouldn't include source maps, but if you do manage to lose your source files, or for some (obviously, ethical!) reason need to view the original files, and you happen to have / find the source maps, you're good to go.
How to run examples:
- Run $ createdb nplusonedb to create DB
- Run specs $ rspec demo.rb