Skip to content

Instantly share code, notes, and snippets.

const digit = (num, pos) => {
const str = num.toString()[pos]
return typeof str === "undefined" ? 0 : parseInt(str)
}
const maxDigits = input => input.reduce((accum, value) => {
const len = value.toString().length
return accum < len ? len : accum
}, null)
{
  "width": 3256,
  "height": 1318,
  "data": [
    {
      "name": "polytable1",
      "format": "polys",
      "shapeColGroup": "mapd",
      "sql": "SELECT zipcodes.rowid,AVG(contributions_donotmodify.amount) AS avgContrib FROM contributions_donotmodify,zipcodes WHERE contributions_donotmodify.amount IS NOT NULL AND contributions_donotmodify.contributor_zipcode = zipcodes.ZCTA5CE10 GROUP BY zipcodes.rowid ORDER BY avgContrib DESC"
function createStandInChart (cfGroup) {
const chart = {}
chart.redrawAsync = function () {
cfGroup.all().then(data => {
dispatch(updateChartData(data))
})
}

Releasing

Terms

Release Captain

the team member responsible for managing the release branch and communicating with QA and management about the status of the current release

Release
@mrblueblue
mrblueblue / line-chart-vega.md
Last active May 9, 2017 03:36
Vega Sketchpad
SELECT
  date_trunc(year, CAST(contrib_date AS TIMESTAMP(0))) as key0,
  AVG(amount) AS series_1
FROM contributions_donotmodify
WHERE
  (CAST(contrib_date AS TIMESTAMP(0)) >= TIMESTAMP(0) '1996-11-05 17:47:30'
  AND CAST(contrib_date AS TIMESTAMP(0)) <= TIMESTAMP(0) '2010-10-21 10:54:07')
  AND amount IS NOT NULL
GROUP BY key0
import R from "ramda"
function transducer (xform, stepper, init, input) {
const reducer = (accum, value) => stepper(accum, value)
const transduce = R.compose(R.reduce(reducer, init), xform)
return transduce(input)
}
import {PropTypes} from 'react'
import {compose, getContext, mapProps} from 'recompose'
const noop = () => ({})
function connect(mapStateToProps = noop, mapDispatchToProps = noop) {
return compose(
getContext({
store: PropTypes.shape({
getState: PropTypes.func,
import {compose, getContext, mapProps} from 'recompose'
function connect(mapStateToProps, mapDispatchToProps) {
return compose(
getContext({
store: Proptypes.shape({
getState: Proptypes.func,
dispatch: Proptypes.func,
subscribe: Proptypes.func,
})
// JSX
<Form>
<Row>
<Input />
</Row>
</Form>