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
test snippet |
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 React, { PropTypes } from 'react'; | |
import Lightbox from 'react-images'; | |
import styled from 'styled-components'; | |
const Container = styled.div` | |
display: flex; | |
justify-content: flex-start; | |
flex-flow: row wrap; | |
width: ${p => p.width}px; | |
`; |
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
export function actionTypeBuilder(prefix) { | |
return { | |
type: actionType => `${prefix}/${actionType}`, | |
loading: actionType => `${actionType}/loading`, | |
ready: actionType => `${actionType}/ready`, | |
stopped: actionType => `${actionType}/stopped`, | |
changed: actionType => `${actionType}/changed`, | |
error: actionType => `${actionType}/error`, | |
success: actionType => `${actionType}/success` | |
}; |
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
/* | |
First run npm install topojson --save and then link "node_modules/topojson/build/topojson.min.js" | |
above this snippet in your html. | |
Usage: http://leafletjs.com/reference.html#geojson | |
*/ | |
L.TopoJSON = L.GeoJSON.extend({ | |
addData: function (data) { | |
var geojson, key; |
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 bodyParser from 'body-parser'; | |
import url from 'url'; | |
const handleRequest = (method, path, cb) => { | |
WebApp.rawConnectHandlers.use(path, (req, res, next) => { | |
if (req.method !== method) { | |
next(); | |
return; | |
} |
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
componentDidUpdate(prevProps) { | |
if ( | |
this.props.image?.type !== prevProps.image?.type || | |
this.props.image?.orientation !== prevProps.image?.orientation | |
) { | |
// ... | |
} | |
} |
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
var canEdit = user?.can?.edit; | |
var canDelete = user?.can?.delete; | |
// transpiles to: | |
"use strict"; | |
var _user, _user$can, _user2, _user2$can; | |
var canEdit = | |
(_user = user) === null || _user === void 0 |
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
var can = user?.can || {}; | |
var canEdit = can.edit; | |
var canDelete = can.delete; | |
// transpiles to: | |
"use strict"; | |
var _user; | |
var can = |
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
var can = user && user.can || {}; | |
var canEdit = can.edit; | |
var canDelete = can.delete; | |
// transpiles to: | |
"use strict"; | |
var can = (user && user.can) || {}; | |
var canEdit = can.edit; | |
var canDelete = can.delete; |
OlderNewer