Skip to content

Instantly share code, notes, and snippets.

Brian Zerangue bzerangue

Block or report user

Report or block bzerangue

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View error.txt
Error: Cannot find module './cors/addCorsOriginCommand'
Require stack:
- /Users/bmz/Dev/sanity/eleventy-sanity-blog-boilerplate/eleventyboilerplate/node_modules/@sanity/core/lib/commands/index.js
- /Users/bmz/Dev/sanity/eleventy-sanity-blog-boilerplate/eleventyboilerplate/node_modules/@sanity/core/lib/index.js
- /usr/local/lib/node_modules/@sanity/cli/bin/sanity-cli.js
- /usr/local/lib/node_modules/@sanity/cli/bin/sanity
at require (/usr/local/lib/node_modules/@sanity/cli/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
at Object.<anonymous> (~/Dev/sanity/eleventy-sanity-blog-boilerplate/eleventyboilerplate/node_modules/@sanity/core/lib/commands/index.js:64:52)
at Module._compile (/usr/local/lib/node_modules/@sanity/cli/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
@bzerangue
bzerangue / a_README.md
Last active Jun 10, 2019
Migrating Symphony CMS REST API data to Sanity.io
View a_README.md

Migrating Symphony CMS REST API data to Sanity.io

Note: Using jq to transform JSON data.

  1. Original Data from the REST API extension in Symphony CMS --> example-01.json

  2. Clean-up original json data with jq from the command-line. --> example-02.json (cleaner JSON data)

cat example-01.json | jq '[.response.entry[] | {_type: "sermons", title: .title.value, date: .date.date.start._iso, scripture: .scripture.value, speaker: .["speaker-name"].value,audio: .["simplecast-url"].value}]' > example-02.json
View json-to-ndjson.md

NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.

  • Each line is a valid JSON value
  • Line separator is ‘\n’

1. Convert JSON to NDJSON?

cat test.json | jq -c '.[]' > testNDJSON.json
@bzerangue
bzerangue / function_RecursiveArraySearch.php
Last active Dec 13, 2018
PHP: Recursive Array Search Function
View function_RecursiveArraySearch.php
<?php
/*
=====
Find integer value of array key for search term in the $needle.
=====
*/
function recursive_array_search($needle,$haystack) {
@bzerangue
bzerangue / index.html
Created Oct 10, 2018
VueJS Audio Player V2!
View index.html
<div id="app">
<div class="heading">
<h1>VueJS Audio Player V2</h1>
<p>(photos from <a href="https://unsplash.com/">unsplash</a> &amp; audios from <a href="https://soundbible.com/">soundbible</a>)</p>
</div>
<div class="audioContainer">
<a class="nav-icon" v-on:click="isPlaylistActive=!isPlaylistActive" :class="{'isActive': isPlaylistActive}" title="Music List">
<span></span>
View master.xml
<?xml version="1.0" encoding="UTF-8"?>
<data rootUrl="https://static.pcpc.org" path="/audio/union/" folder="union">
<files>
<entry order="01">
<title>Meaning of Marriage</title>
<speaker>Paul Goebel</speaker>
<audio file="01__UNION__Meaning-of-Marriage__Paul_Goebel.mp3">https://static.pcpc.org/audio/union/01__UNION__Meaning-of-Marriage__Paul_Goebel.mp3</audio>
</entry>
<entry order="02">
<title>Leaving and Cleaving and In-Laws</title>
@bzerangue
bzerangue / MySQL_macOS_Sierra.md
Created Sep 11, 2018 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew
View MySQL_macOS_Sierra.md

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

View to-csv.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:variable name="delimiter" select="','" />
<!-- define an array containing the fields we are interested in -->
<xsl:variable name="fieldArray">
<field>date</field>
<field>ny_conventional_gasoline_spot_price_gal</field>
@bzerangue
bzerangue / nasa.xsl
Created Jul 21, 2018 — forked from netsensei/nasa.xsl
Converts XML output of the US GSA Social Media API to CSV - http://registry.usa.gov/accounts.xml?agency_id=nasa
View nasa.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:variable name="delimiter" select="','" />
<!-- define an array containing the fields we are interested in -->
<xsl:variable name="fieldArray">
<field>service_id</field>
<field>account</field>
@bzerangue
bzerangue / script.rb
Last active Mar 12, 2018
Contentful Import CMA Script - Ruby Example
View script.rb
# This Open Beer Database data is made available under the Open Database License.
# Any rights in individual contents of the database are licensed under the Database Contents License.
# http://openbeerdb.com/
require 'contentful/management'
require 'csv'
# function to create slugs
def slugify(str)
str.ljust(100).strip.gsub(/[\s\t\r\n\f]/,'_').gsub(/\W/,'').downcase
You can’t perform that action at this time.