Skip to content

Instantly share code, notes, and snippets.

View redux-store-wrapper.js
/* eslint-disable import/prefer-default-export */
import * as R from 'ramda';
/**
* @curried
* @param {Object} reducer The simplified reducer object, i.e. { increment: (state, payload) => state + payload }
* @param {Object} initialState Initial state for the reducer function
* @returns {Function} Generalized reducer using the Ramda Cond pattern (http://ramdajs.com/docs/#cond)
*/
export const reducerWrapper = (reducer, initialState) => (state = initialState, action) => R.pipe(
@david-mart
david-mart / locations.json
Created Sep 18, 2019
/srv/administration/locations/list
View locations.json
[
{
"id": 953,
"name": "Large Campus",
"accountId": 328,
"accountName": "Gloo Church Analytics Demo",
"address": {
"address": "805 Walnut St",
"city": "Boulder",
"state": "CO",
@david-mart
david-mart / get.json
Created Sep 18, 2019
/current-user/get
View get.json
{
"id": 1836,
"firstName": "David",
"lastName": "Mart",
"email": "david.mart@sadasystems.com",
"superUser": false,
"accountAccess": [
{
"accountName": "Gloo Church Analytics Demo",
"accountId": 328,
View react-marker.js
import ReactDOMServer from 'react-dom/server';
import MarkerSvg from './marker-svg';
const encodeSvg = reactElement =>
'data:image/svg+xml;charset=utf-8,' +
encodeURIComponent(ReactDOMServer.renderToStaticMarkup(reactElement))
const marker = {
position: {
lat: "34.1683776"
View marker.js
import { getColoredIconUrl } from "./icon-url-generator"
const myColoredMarker = {
position: {
lat: "34.1683776"
lng: "-118.3826831"
},
icon: {
url: getColoredIconUrl("#C0FFEE", "#B00B1E"),
anchor: { x: 14, y: 14 }
@david-mart
david-mart / icon-url-generator.js
Last active May 23, 2020
icon-url-generator.js
View icon-url-generator.js
import Vue from 'vue'
import LocationIcon from './LocationIcon'
// create a constructor from a Vue component
const LocationIconConstructor = Vue.extend(LocationIcon)
export const getColoredIconUrl = (fillColor, strokeColor) => {
// create a Vue element with required props
const iconComponent = new LocationIconConstructor({ propsData: { fillColor, strokeColor } })
// mount the component shadow DOM
View marker-svg.2.vue
<template>
<svg
width="28"
height="28"
viewBox="0 0 28 28"
>
<defs>
<circle id="my-location-a" cx="14" cy="14" r="8" />
</defs>
<g fill="none" fill-rule="evenodd">
View marker-svg.1.vue
<template>
<svg
width="28"
height="28"
viewBox="0 0 28 28"
>
<defs>
<circle id="my-location-a" cx="14" cy="14" r="8" />
</defs>
<g fill="none" fill-rule="evenodd">
View sada-db-sql.sql
SELECT Domain from bill_items group by Domain;
select
Domain,
Product_Name,
sum(Amount) as total,
DATEPART(Month, Start_Date) as Month,
DATEPART(Year, Start_Date) as Year
from bill_items
group by
View missing customers
[
{
"Domain": "trademotion.com"
},
{
"Domain": "tuilifestyle.com"
},
{
"Domain": "selectiveps.com"
},