Skip to content

Instantly share code, notes, and snippets.

View esmevane's full-sized avatar

Joseph McCormick esmevane

View GitHub Profile
@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
@esmevane
esmevane / dreamcode.ts
Created August 15, 2017 11:26
[ Typescript / Javascript / Chai / Draftjs ]: Wouldn't it be nice if there were Draft.js chai helpers?
import chai, { expect } from 'chai'
import { EditorState } from 'draft-js'
expect(editorState).to.have.content(contentState)
expect(contentState).to.eql.content(otherState)
expect(editorState).to.have.block(contentBlock)
@esmevane
esmevane / HasStylesheet.elm
Last active July 28, 2017 13:10
[ Elm / Stylesheets / Interop ]: Use Elm & Javascript interop to allow for CSS modules in Elm files
module HasStylesheet exposing (..)
import Html exposing (Html, div, text)
import Html.Attributes exposing (class)
import Stylesheets exposing (fetchClasses, getClass, onlyFor)
type Message
= NoOp
| ReceiveStyles Stylesheets.Message