This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Simple example: WORKS | |
followSplit : Mod -> Mod | |
followSplit oldMod = | |
let | |
newTransformer : Node -> Node | |
newTransformer node = | |
case node of | |
Split nodes -> | |
let |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int c; | |
while ((c = getchar()) != EOF) { | |
putchar(c); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Parent extends Component { | |
state = { | |
data: null, | |
}; | |
componentWillMount() { | |
loadData().then(data => { | |
this.setState({ data }); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MyComponent = ({ foo }) => ( | |
<div>{foo}</div> | |
); | |
// using connect | |
const FinalConnected = connect(mapStateToProps)(MyComponent); | |
// using subjects | |
const FinalSubjected = () => ( | |
<Foo render={({ get }) => ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Fragment } from 'react'; | |
import { | |
StringAttribute, | |
} from 'exp-ui-api-lib'; | |
const defaultStyle = { | |
backgroundSize: 'contain', | |
backgroundRepeat: 'no-repeat', | |
backgroundPosition: 'center top', | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function recaptchaCallback(token) { | |
console.log(‘recaptcha response’, token); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'), | |
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const processData = someExpensiveFunction; | |
const mapStateToProps = state => ({ | |
foos: processData(getFoos(state)), | |
}); | |
const MyComponent = props => ( | |
<div>baz: {props.baz}</div> | |
<SubComponent data={props.foos} /> |
NewerOlder