Skip to content

Instantly share code, notes, and snippets.

@bzerangue
bzerangue / x86-raspi-screenly-ose.md
Last active February 15, 2021 21:43
Running Screenly OSE on Raspberry Pi Desktop for x86 (PC) - instructions [this is not supported - this is a hack to get it to work]

NOTE: These are not official instructions for the getting Screenly OSE to run on Raspberry Pi Desktop for x86 machines. This was a hack. These instructions are not supported. I posted them here to remember the steps I took to get it to work. Use at your own risk.

Step 1

  • Load Wifi deb files onto USB
  • Install Raspberry Pi Desktop for x86 PC - Raspberry Pi Debian Stretch - 2019-04-11-rpd-x86-stretch.iso

Step 2

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 June 10, 2019 15:52
Migrating Symphony CMS REST API data to Sanity.io

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}]' &gt; example-02.json
@bzerangue
bzerangue / json-to-ndjson.md
Last active January 31, 2024 20:57
JSON to NDJSON

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 December 13, 2018 17:01
PHP: Recursive Array Search Function
<?php
/*
=====
Find integer value of array key for search term in the $needle.
=====
*/
function recursive_array_search($needle,$haystack) {
@bzerangue
bzerangue / index.html
Created October 10, 2018 23:50
VueJS Audio Player V2!
<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>
<?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 September 11, 2018 21:22 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

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 :

<?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 July 21, 2018 13:03 — 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
<?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>