Skip to content

Instantly share code, notes, and snippets.

@vire
vire / machine.js
Created September 16, 2022 12:28
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

Everything I Know About UI Routing

Definitions

  1. Location - The location of the application. Usually just a URL, but the location can contain multiple pieces of information that can be used by an app
    1. pathname - The "file/directory" portion of the URL, like invoices/123
    2. search - The stuff after ? in a URL like /assignments?showGrades=1.
    3. query - A parsed version of search, usually an object but not a standard browser feature.
    4. hash - The # portion of the URL. This is not available to servers in request.url so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.
    5. state - Object associated with a location. Think of it like a hidden URL query. It's state you want to keep with a specific location, but you don't want it to be visible in the URL.
const autoprefixer = require('autoprefixer');
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const InterpolateHtmlPlugin = require('interpolate-html-plugin');
const eslintFormatter = require('react-dev-utils/eslintFormatter');
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
const getClientEnvironment = require('./env');
const paths = require('./paths');
import { marbles } from "rxjs-marbles/jest";
import { map, startWith, scan } from "rxjs/operators";
import { Subject, merge, of } from "rxjs";
describe("basic", () => {
it(
"should update state by calling the handler as expected",
marbles(m => {
const createHandler = () => {
const stream$ = new Subject();
process.env.NODE_ENV = 'production'
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const webpackConfigProd = require('react-scripts/config/webpack.config.prod')
webpackConfigProd.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
reportFilename: 'report.html'
})
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"bracketSpacing": false,
"jsxBracketSameLine": true,
"singleQuote": true,
"trailingComma": "none"
}
@vire
vire / .flowconfig
Created March 9, 2017 14:44 — forked from MoOx/.flowconfig
flow config webpack adjustements to avoid the "Required module not found" for png, css, svg etcc
# ...
[options]
# webpack loaders
module.name_mapper='.*\.css$' -> '<PROJECT_ROOT>/flow/stub/css-modules.js'
module.name_mapper='.*\.\(svg\|png\|jpg\|gif\)$' -> '<PROJECT_ROOT>/flow/stub/url-loader.js'

Keybase proof

I hereby claim:

  • I am vire on github.
  • I am vire (https://keybase.io/vire) on keybase.
  • I have a public key whose fingerprint is 5EDA 5161 27AF 15DE 2CFC CB07 A69B 3F60 DD22 97D1

To claim this, I am signing this object:

[
{
"lat": 50.076191,
"lng": 14.514925,
"minutes": 15
},
{
"lat": 50.068435,
"lng": 14.507169,
"minutes": 49
{
"agent": {
"active": true|false,
},
"recipes": {
"-KMYW_ER79aPDAe3mJuY": {...},
"-KMYW_ER79aPDAe1234Y": {...},
"-KMYW_DGADaPDAe3mJuZ": {...}
}
}