Skip to content

Instantly share code, notes, and snippets.

rootedsoftware / CosmosDB queries
Created January 10, 2020 14:45
Common CosmosDB queries I can never remember
View CosmosDB queries
Find a document that has an array value of "artist" in the keyAudience array
where ARRAY_CONTAINS(c.keyAudiences, "artist")
View Heroku Prisma Server upgrade
I looked up prisma's latest docker hub tags at and picked 1.14-heroku (not sure what the difference is in *-heroku tags, but it sounded reasonable. Could someone from Prisma explain the difference?)
I read Heroku's docs on docker deployment and followed this section:
Here's the exact steps I ran:
Pulled the docker image w/ the tag mentioned above: docker pull prismagraphql/prisma:1.34-heroku
Looked up the image id from the image I just pulled using: docker images
Using that image id, I tagged it to my Heroku repo: docker tag 6ff588b05d59${HEROKU_APP_NAME}/web
rootedsoftware / findDuplicatesInArrayOfObjects.js
Last active October 18, 2019 20:14
Sort an Array by property, then find the duplicates by that property
View findDuplicatesInArrayOfObjects.js
const users = [
firstName: 'Sarah',
lastName: 'Zulu',
email: '',
firstName: 'Josh',
lastName: 'Able',
email: '',
rootedsoftware / sortArrayOfObjects.js
Last active October 18, 2019 20:06
Sort an Array of Objects in JS
View sortArrayOfObjects.js
const users = [
firstName: 'Sarah',
lastName: 'Zulu',
firstName: 'Josh',
lastName: 'Able',
View InboxScreen.js
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import Inbox from './Inbox';
import TaskList from '../components/TaskList';
const withData = graphql(
query InboxQuery {
me {
rootedsoftware / gist:7be337529c9bda8475abf2b818dce733
Created August 31, 2016 13:47
Function which converts string "Y" or "N" to true and false
View gist:7be337529c9bda8475abf2b818dce733
var convertStringToBoolean = function(yourVariable){
return yourVariable ? yourVariable === "Y" ? true : false : null;
rootedsoftware / gist:1abfffd4544a8d438cf0
Created March 26, 2015 22:05
Stripe update customer
View gist:1abfffd4544a8d438cf0
Trying this
Stripe.customers.update(customer_id, {
"": form[''],
"metadata.state": form['address.state'],
"metadata.address_line1": form['address.address_line1'],
"metadata.address_line2": form['address.address_line2'],
"metadata.postal_code": form['address.postal_code'],
}, function (error, customer) {
View gist:6e610514705c503c1118
// Import the official balanced nodejs package
var balanced = require('balanced-official');
// Create a new API Key and configure the client with it
// The client automatically creates a new test marketplace for us
// if a marketplace does not exist for the api key
// Create a customer with some dummmy data
balanced.get('').then(function(debit) {
View gist:f642f378713110fca7be
"_id" : "Philippines Infrastructure",
"total" : 3400,
"count" : 1
"_id" : "Philippines Urgent",
"total" : 1100,
"count" : 1
View gist:fc737d6bafb8d329bf5a
{ _api:
I20141209-15:18:16.384(-6)? { base_url: '',
I20141209-15:18:16.385(-6)? request_args: { headers: [Object], auth: [Object] },
I20141209-15:18:16.385(-6)? routes:
I20141209-15:18:16.385(-6)? { marketplaces: [Object],
I20141209-15:18:16.385(-6)? customers: [Object],
I20141209-15:18:16.385(-6)? bank_accounts: [Object],
I20141209-15:18:16.385(-6)? orders: [Object] },
I20141209-15:18:16.385(-6)? cache:
I20141209-15:18:16.385(-6)? { '/marketplaces/TEST-MP14BPoPFdKRdPSEx6V15MIl': [Object],