Skip to content

Instantly share code, notes, and snippets.

@nicovalencia
nicovalencia / react-hoc-context-example.js
Created March 4, 2019 19:12
React HOC Context Example
import React from 'react';
const DataContext = React.createContext();
class DataProvider extends React.Component {
state = {
items: [
"Thing 1",
"Thing 2",
"Thing 3",
contract EternalStorage{
mapping(bytes32 => uint) UIntStorage;
function getUIntValue(bytes32 record) constant returns (uint){
return UIntStorage[record];
}
function setUIntValue(bytes32 record, uint value)
{
@whichlight
whichlight / art-demo-links.md
Last active August 29, 2015 14:02
materials for jsconf talk
@robacarp
robacarp / a_generator_framework.md
Last active October 12, 2015 06:18
Sane, Simple Rails Generator framework to replace FactoryGirl, Machinist, Fabrication, and Rails Fixtures

##Intro

Generator frameworks spend way too much time creating obscure and pointless DSL syntax just to make the code trendy and cute. This generator comes in the form of pure ruby, instantiates real model objects (which fire their pre-, post- and other hooks appropriately), and still allows for a simple syntax to override parameters of generated objects.

Standard Ruby syntax allows for easier adoption by new programmers and reinforces ruby paradigms, instead of breaking them down with a cute, often incomplete, and entirely superfluous DSL syntax.

Specific complaints against existing frameworks:

  • Rails fixtures: definition syntax (yaml) doesn't provide a powerful enough interface to rapidly creating objects.
  • FactoryGirl: Factories are evaluated at load-time, making some factories just awful to define. No further comment on DSLs.