Skip to content

Instantly share code, notes, and snippets.

View collinglass's full-sized avatar

4RCH!73C7 collinglass

View GitHub Profile
export default class MessageContainer extends React.Component {
// ...
renderFooter() {
if (this.props.renderFooter) {
const footerProps = {
...this.props,
};
return this.props.renderFooter(footerProps);
}
return null;
renderLoadEarlier(loadEarlierProps) {
return <MyLoadEarlier
text={loadEarlierProps.content}
/>
}
render() {
return <MessageContainer {...props} renderHeader={this.renderHeader}>
}
// ...
render() {
return <MessageContainer
{...props}
renderLoadEarlier={() => null}
/>
}
export default class Card extends Component {
constructor(props) {
super(props);
}
renderHeader(headerProps) {
if (!this.props.renderHeader) {
return this.props.renderHeader(headerProps)
}
{
"data": {
"result": null,
"type": "object",
"parent": "/api/users",
"options": {}
},
"error": {
"type": "not found",
"message": "no users found",
_, err := TrollIEUsers()
if err != nil {
handleError(w, err)
return
}
type APIResponse struct {
Data interface{} `json:”data”`
Error string `json:”error”`
Status int `json:”status”`
}
@collinglass
collinglass / deepcopy.js
Last active August 29, 2015 14:15
javascript snippets
// function to deep copy an object
function deepCopy(object) {
return JSON.parse(JSON.stringify(object));
}
@collinglass
collinglass / .pagevue.js
Last active September 1, 2019 09:33
Simple Multi-View Routing with Page.js and Vue.js
Simple Multi-View Routing with Page.js and Vue.js