Skip to content

Instantly share code, notes, and snippets.

@esmevane
esmevane / index.tsx
Created November 7, 2018 04:24
[ Typescript / React / ProseMirror ]: Put React components into ProseMirror NodeViews
// This assumes Styled Components is in play, as well.
//
// Here we have the (too simple) React component which
// we'll be rendering content into.
//
class Underlined extends React.Component<any, any> {
public hole: HTMLElement | null
// We'll put the content into what we render using
Login
Incomplete form*
Empty*
Add username -> Username filled out
Add password -> Password filled out
Submit -> Empty
Username filled out
Add password -> All fields filled out
Submit -> Username required prompt
Password filled out
@esmevane
esmevane / Block.tsx
Created October 31, 2018 00:44
[ Typescript / React ]: Spiking out a react-and-BEM mix with context
import * as enzyme from 'enzyme';
import { uniq } from 'lodash';
import * as React from 'react';
const BlockContext = React.createContext('');
interface BlockElementProps {
className?: string;
modifier?: string;
name?: string;
@esmevane
esmevane / SketchSystems.spec
Last active October 5, 2018 20:04
ProseDB Notepad*
ProseDB Notepad*
No Notes*
Create Note -> One Note
One Note
@esmevane
esmevane / index.tsx
Created September 24, 2018 20:20
[ Typescript / React / Webpack / Create React App ]: Example hot reloading setup
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import App from 'components/App'
import 'index.css'
import registerServiceWorker from 'registerServiceWorker'
const root: HTMLElement | null = document.getElementById('root')
if (root) {
@esmevane
esmevane / introrx.md
Created February 2, 2018 01:13 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@esmevane
esmevane / index.js
Last active December 14, 2017 15:39
[ React / Styling / Typography / Layout ]: Basic style display page (cribbed from Bourbon Bitters - http://bitters.bourbon.io/example.html)
import React from 'react'
import styled from 'styled-components'
const WelcomeBanner = styled.header``
const Main = styled.main``
const Paragraph = styled.p``
const Headings = {
One: styled.h1``,
Two: styled.h2``,
@esmevane
esmevane / Proxy.scala
Created December 7, 2017 14:41 — forked from rklaehn/Proxy.scala
Minimal akka http proxy
package akkahttptest
import akka.actor.ActorSystem
import akka.http.Http
import akka.stream.FlowMaterializer
import akka.http.server._
import akka.http.marshalling.PredefinedToResponseMarshallers._
import akka.stream.scaladsl.{HeadSink, Source}
object Proxy extends App {
@esmevane
esmevane / README.md
Last active January 26, 2018 15:35
[ Markdown / React / Front-end / Components ]: Interesting React & Front-end libs