Skip to content

Instantly share code, notes, and snippets.

@rootedsoftware
rootedsoftware / gist:7be337529c9bda8475abf2b818dce733
Created August 31, 2016 13:47
Function which converts string "Y" or "N" to true and false
var convertStringToBoolean = function(yourVariable){
return yourVariable ? yourVariable === "Y" ? true : false : null;
}
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import Inbox from './Inbox';
import TaskList from '../components/TaskList';
const withData = graphql(
gql`
query InboxQuery {
me {
@rootedsoftware
rootedsoftware / sortArrayOfObjects.js
Last active October 18, 2019 20:06
Sort an Array of Objects in JS
const users = [
{
firstName: 'Sarah',
lastName: 'Zulu',
},
{
firstName: 'Josh',
lastName: 'Able',
},
@rootedsoftware
rootedsoftware / findDuplicatesInArrayOfObjects.js
Last active October 18, 2019 20:14
Sort an Array by property, then find the duplicates by that property
const users = [
{
firstName: 'Sarah',
lastName: 'Zulu',
email: 'sarah.zulu@test.com',
},
{
firstName: 'Josh',
lastName: 'Able',
email: 'sarah.zulu@test.com',
https://github.com/prisma/prisma-cloud-feedback/issues/202#issuecomment-414095090
I looked up prisma's latest docker hub tags at https://hub.docker.com/r/prismagraphql/prisma/tags/ 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: https://devcenter.heroku.com/articles/container-registry-and-runtime#pushing-an-existing-image.
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 registry.heroku.com/${HEROKU_APP_NAME}/web
@rootedsoftware
rootedsoftware / CosmosDB queries
Created January 10, 2020 14:45
Common CosmosDB queries I can never remember
Find a document that has an array value of "artist" in the keyAudience array
where ARRAY_CONTAINS(c.keyAudiences, "artist")