Skip to content

Instantly share code, notes, and snippets.

@cdaringe
cdaringe / gatsby-config.js
Created October 2, 2018 05:24
gatsby-config.js
const markdown = [
`gatsby-plugin-sharp`,
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
{
resolve: `gatsby-remark-images`,
options: { maxWidth: 590 }
},
@cdaringe
cdaringe / react-super-hoc-design.md
Last active August 15, 2018 00:58
react-super-hoc-design

problem

higher-order components must provide

  • easily extensible layouts
  • good default components
  • mechanisms to control default components
  • easily extensible/swappable components

providing a "free" high-level tree of components whilst offering low-level extensibility can

"cc" "-m64" "-L"
"/Users/cdieringer/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib"
"/Users/cdieringer/node/clipster/native/target/debug/deps/clippy_rust.16u6js6g0l3k1ic6.rcgu.o"
"/Users/cdieringer/node/clipster/native/target/debug/deps/clippy_rust.181cuta0v63atwcm.rcgu.o"
"/Users/cdieringer/node/clipster/native/target/debug/deps/clippy_rust.1im38lueib99jsk0.rcgu.o"
"/Users/cdieringer/node/clipster/native/target/debug/deps/clippy_rust.1jnlhyxj59jycbjv.rcgu.o"
"/Users/cdieringer/node/clipster/native/target/debug/deps/clippy_rust.1mnipzq70fk1uuwb.rcgu.o"
"/Users/cdieringer/node/clipster/native/target/debug/deps/clippy_rust.1rbjies67ajfbn12.rcgu.o"
"/Users/cdieringer/node/clipster/native/target/debug/deps/clippy_rust.1y16o1qfye96o7m0.rcgu.o"
"/Users/cdieringer/node/clipster/native/target/debug/deps/clippy_rust.1zwd8n7bcl3vhvvh.rcgu.o"
@cdaringe
cdaringe / console-terminal-task-graph.js
Created March 3, 2018 20:31
console-terminal-task-graph.js
var simpleTree = {
a: {
dependsOn: [
'b',
'x'
]
},
x: {
dependsOn: [
'y'
@cdaringe
cdaringe / mod.rs
Created December 16, 2017 18:30
mod.rs
#[get("/thing")]
fn thing<'a>() -> content::Json<&'static str> {
let res : String = SOME_JSON_VALUE.dump();
return content::Json(res.as_str());
}
error[E0597]: `res` does not live long enough
--> src/main.rs:33:26
|
@cdaringe
cdaringe / index.html
Created November 20, 2017 16:36 — forked from anonymous/index.html
Form Bugs // source http://jsbin.com/tebeqalaju
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<title>Form Bugs</title>
</head>
<body>
<form id='wacky-form'>
@cdaringe
cdaringe / my-best-guesser-thing.py
Created November 15, 2017 04:26
make a model and predict hypothetical max on-the-fly
import sys
import json
from sklearn import linear_model
import numpy as np
from scipy.optimize import basinhopping
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import make_pipeline
class Guess:
Thu Jun 22 19:33:48 UTC 2017
@cdaringe
cdaringe / index.js
Created February 3, 2017 23:00
vscode-hover-wrong-variable-data.js
// install rxjs
// configure vscode to run this file
const Rx = require('rxjs')
const { Observable } = Rx
const EventEmitter = require('events')
const myEmitter = new EventEmitter()
const START_REGISTRATIONS_POLL = 'START_REGISTRATIONS_POLL'
const STOP_REGISTRATIONS_POLL = 'STOP_REGISTRATIONS_POLL'
@cdaringe
cdaringe / index.html
Created January 26, 2017 00:58 — forked from anonymous/index.html
JS Bin // source http://jsbin.com/wugayu
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/react@15.2.1/dist/react.min.js"></script>
<script src="https://unpkg.com/react-dom@15.2.1/dist/react-dom.min.js"></script>
<script src="https://unpkg.com/redux@^3.5.2/dist/redux.min.js"></script>
<script src="https://unpkg.com/react-redux@4.4.5/dist/react-redux.min.js"></script>
<script src="https://unpkg.com/@reactivex/rxjs/dist/global/Rx.js"></script>
<script src="https://unpkg.com/redux-observable/dist/redux-observable.min.js"></script>
<meta charset="utf-8">