Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bhoriuchi's full-sized avatar

Branden Horiuchi bhoriuchi

View GitHub Profile
@bhoriuchi
bhoriuchi / Merge-GraphQL-TypeDefs
Created May 10, 2019 20:11
Merge multiple GraphQL typeDefs into a single typeDef
import { parse, print } from 'graphql'
/**
* Merges multiple graphql definitions into a single one
* with the ability to merge fields and perform conflict
* resolution on types and fields with custom functions
*/
export function mergeDefinitions(documents, options) {
const types = {};
const opts = Object.assign({
@bhoriuchi
bhoriuchi / chef-databag-v3.js
Created April 23, 2019 20:22
nodejs Chef Databag V3 Encrypt/Decrypt
import crypto from 'crypto';
// decrypt a v3 databag
export function decryptV3(data, key) {
try {
const decipher = crypto.createDecipheriv(
data.cipher.trim(),
crypto
.createHash('sha256')
.update(key.trim())
@bhoriuchi
bhoriuchi / update-plex-container.sh
Created December 9, 2017 07:04
Update Plex docker image
#!/bin/bash
docker pull plexinc/pms-docker
docker stop plex
docker rm plex
# set volumes per your environment
docker run \
-d \
--name plex \