Skip to content

Instantly share code, notes, and snippets.

View tristanpendergrass's full-sized avatar

Tristan tristanpendergrass

  • Dropbox
  • Seattle, WA
View GitHub Profile
-- Simple example: WORKS
followSplit : Mod -> Mod
followSplit oldMod =
let
newTransformer : Node -> Node
newTransformer node =
case node of
Split nodes ->
let
import java.io.*;
import java.util.*;
/*
* [1, 3, 4, 5, 7, 8]
p id
* [5, 1, 4, 3, 7, 8]
p id
* [1, 5, 4, 3, 7, 8]
{
"designer template 1": {
"uuid": "ccd2d646-1576-423d-86b5-52be92164eec",
"name": "Designer Holiday Template",
"type": "template",
"status": "active",
"sort": {
"name": "designer holiday template"
},
"labels": ["general", "holiday"]
#include <stdio.h>
int main() {
int c;
while ((c = getchar()) != EOF) {
putchar(c);
}
}
class Parent extends Component {
state = {
data: null,
};
componentWillMount() {
loadData().then(data => {
this.setState({ data });
});
}
const MyComponent = ({ foo }) => (
<div>{foo}</div>
);
// using connect
const FinalConnected = connect(mapStateToProps)(MyComponent);
// using subjects
const FinalSubjected = () => (
<Foo render={({ get }) => (
import { Fragment } from 'react';
import {
StringAttribute,
} from 'exp-ui-api-lib';
const defaultStyle = {
backgroundSize: 'contain',
backgroundRepeat: 'no-repeat',
backgroundPosition: 'center top',
}
function recaptchaCallback(token) {
console.log(‘recaptcha response’, token);
}
// imperative
const isSelected = playlist => {
const slides = getOr([], 'config.slides', playlist);
return some(matchesProperty('key', item.key), slides);
};
// functional
const isSelected = compose([
partial(some, matchesProperty('key', item.key)),
partial(getOr, [], 'config.slides'),
]);
const processData = someExpensiveFunction;
const mapStateToProps = state => ({
foos: processData(getFoos(state)),
});
const MyComponent = props => (
<div>baz: {props.baz}</div>
<SubComponent data={props.foos} />