First, an exercise. Can we represent all of css with plain data? Let's try.
let redText = { color: 'red' };| <!-- | |
| Put this file in ~/Library/LaunchAgents/com.example.KeyRemapping.plist to | |
| automatically remap your keys when macOS starts. | |
| See https://developer.apple.com/library/archive/technotes/tn2450/_index.html for | |
| the key "usage IDs". Take the usage ID and add 0x700000000 to it before putting it | |
| into a source or destination (HIDKeyboardModifierMappingSrc and | |
| HIDKeyboardModifierMappingDst respectively). | |
| --> | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| # setup a workspace | |
| mkdir testarc6 | |
| cd testarc6 | |
| npm init -f | |
| npm i @architect/[email protected] | |
| # generate a hello world function | |
| npx arc init | |
| # modify .arc file @aws with a bucket property for deploying |
| // A script to generate a zone file with all the email-related zones required by Fastmail | |
| // Reference: https://www.fastmail.com/help/receive/domains-advanced.html#dnslist | |
| // | |
| // Run this script with node and copy the output to your clipboard | |
| // $ node fastmail-zone yourdomain.com | pbcopy | |
| // | |
| // Paste into AWS Route53 "Import zone file" field when creating a new zone, etc. | |
| const render = (DOMAIN) => { | |
| console.log(`;; Fastmail-hosted zones (email only) |
| module.exports = { | |
| root: true, // make to not take in any user specified rules in parent folders | |
| parser: 'babel-eslint', | |
| extends: ['airbnb', 'prettier', 'prettier/flowtype', 'prettier/react'], | |
| env: { | |
| browser: true, | |
| node: true, | |
| jest: true, | |
| }, | |
| plugins: ['flowtype'], |
| // | |
| // MIT License | |
| // | |
| // Copyright (c) 2018 Ali Sharif | |
| // | |
| // 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 |
| // inifinite scrolling of content without extra wrappers | |
| const { render, findDOMNode } = ReactDOMFiber | |
| class App extends React.Component { | |
| render() { | |
| // wrap the root element with an Intersection Observer, exposing .observe for children | |
| return <Intersection> | |
| <div style={{ height: 200, overflow: 'auto' }}> | |
| <Page offset={0} count={10} /> | |
| </div> |
| import React from 'react'; | |
| const toPromise = (load) => (new Promise((resolve) => ( | |
| load(resolve) | |
| ))); | |
| class LazilyLoad extends React.Component { | |
| constructor() { | |
| super(...arguments); |
| import { Component } from 'react' | |
| import { createStore, combineReducers } from 'redux' | |
| import parseLinkHeader from 'parse-link-header' | |
| const START = 'start' | |
| const SUCCEED = 'succeed' | |
| const ERROR = 'error' | |
| const inflight = (state={}, action) => ( | |
| ((state) => ( |