Skip to content

Instantly share code, notes, and snippets.

@dipunm
dipunm / hello.json
Last active February 5, 2020 15:11
TEMP GIST for an API.
[
{
"id": 201,
"notes": "Hello World",
"createdTimeStampUtc": "2020-02-05T15:10:43.311808+00:00",
"sentToKayakTimeStampUtc": null,
"augmentedTimeStampUtc": "2020-02-08T17:10:43.311905+00:00"
},
{
const LandmarkRestaurantRows = connect(
mapStateToProps,
dispatch => bindActionCreators({
onRestaurantViewed: addRestaurantToQueuedDagImpressions,
}, dispatch)
)(
({restaurants, onRestaurantViewed}) => restaurants.map(restaurant => (
<Restaurant {...restaurant} onRestaurantViewed={onRestaurantViewed} />
))
@dipunm
dipunm / TESTS.md
Last active August 12, 2019 00:56

Testing

Creating modifications and adding of new features should typically be accompanied by tests in one form or another. The exception to this rule would typically be temporary bug fixes or workarounds that is expected to last an objectively short amount of time. In this case, there should be a "time-bomb" associated with the feature/hotfix.

time-bomb: A reminder of some sort to remove said feature after some time that allows others to also hold you or your team accountable. For now, we do not stipulate how to acheive this, we may consider adding a tool or feature in the CFE in order to assist in this endevour.

Getting full coverage

A typical page on the CFE includes:

  • A controller and middleware that:
{
pointOfInterest(landmarkId: 8888) {
name
pointOfInterestId
coordinates{
latitude
longitude
}
radius
nearbys {
import _ from 'lodash';
export default [
...[
{val: 1, name: 'explanations on'},
{val: 2, name: 'explanations on with icon'},
{val: 0, name: 'explanations off'},
].map((opts) => ({
name: opts.name,
dependencies: ['abHelper'],
@dipunm
dipunm / bash
Last active April 4, 2018 17:22
installing ot-react-maps
node -v
# v6.11.2
npm -v
# 4.6.1
git reset --hard HEAD
git status
# no changes
# (remove the line manually from package.json where ot-react-maps is installed)
git status
# package.json modified.
const Tracker = {
Lift: function(value) {
return new Tracker.Monad({}, value);
},
Record: function(state) {
return new Tracker.Monad(state);
},
Errored: function(err) {
return new Tracker.Monad({error: err});
},
class Cursor {
constructor(cursor) {
this.innerCursor = cursor;
this.cached = [];
}
hasNext() {
if(cached.length) return Promise.resolve(true);
return this.innerCursor.fetchSome().then(some => {
this.cached.append(some);
&experiments[sv359]=0&experiments[sv788]=0&experiments[sv957]=0&experiments[sv1181]=0&experiments[sv1352]=0&experiments[sv1369]=0&experiments[sv1371]=0&experiments[sv1375]=0&experiments[sv1467]=0&experiments[sv1564]=0&experiments[sv1622]=0&experiments[sv1744]=0&experiments[sv1785]=0&experiments[sv1793]=0&experiments[sv1803]=0&experiments[sv1817]=0&experiments[sv2111]=0&experiments[sv2123]=0&experiments[sv1936]=0&experiments[sv2013]=1&experiments[sv2024]=0&experiments[sv2043]=0&experiments[sv2046]=0&experiments[freq963]=0&experiments[pretzel939]=0&experiments[sv2134]=0&experiments[sv2137]=0&experiments[sv2228]=0&experiments[fakeExperiment]=0&experiments[fakeExperiment2]=0&experiments[gpt173]=0&experiments[rush1574]=0&experiments[sv912]=0&experiments[sv953]=0&experiments[sv1016]=0&experiments[sv1043]=0&experiments[sv1148]=0&experiments[sv1207]=0&experiments[sv1300]=0&experiments[sv1348]=0&experiments[sv1376Internal]=0&experiments[sv1437]=0&experiments[sv1465]=0&experiments[sv1493]=0&experiments[sv1577]=0&experi