Skip to content

Instantly share code, notes, and snippets.


Ronald Roe ronaldroe

View GitHub Profile
View supplies.html
<!DOCTYPE html>
<title>Delivery/Event Dates | Flower Moxie</title>
<script src=""></script>
<script src=""></script>
<script type="text/javascript" src="supplies.js"></script>
<link rel="stylesheet" href="supply.css" type="text/css" />
<link rel="stylesheet" href="">
View WTF.js
let nav_buttons = document.querySelectorAll('.nav');
function addNavButtonListeners() {
Array.from(nav_buttons).forEach(button => {
button.addEventListener('click', e => {
View XML2JSON.js
const XML2JSON = (xml, selector) => {
let entries = xml.querySelectorAll(selector);
let outData = [];
Array.from(entries).forEach((entry, i) => {
outData[i] = {};
Array.from(entry.children).forEach(node => {
View flatten-test.js
// Decided against a testing framework for something so simple.
// This test takes an array, loops through each top level index
// and logs an error if the index contains an array.
// Passes are tallied, and passes/fails are output at the end of the test.
const flattenTest = arr => {
// Define error message and initialize pass counter
const errorMessage = ind => `Index ${ind} contains an array`;
let passCount = 0;
ronaldroe / cloudSettings
Created Oct 31, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
ronaldroe / Gruntfile.js
Created Mar 8, 2016
My Wordpress Theme Dev Grunt Setup
View Gruntfile.js
module.exports = function(grunt) {
// Project configuration.
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
style: 'expanded',
compass: true
ronaldroe / niceMenu.css
Last active Aug 29, 2015
niceMenu.js - Similar to Mean Menu, but supports converting multiple menus into one
View niceMenu.css
/*!** NICE MENU ***/
/*! Compiled from SCSS - also attached */
body.hasNiceMenu {
padding-top: 44px; }
.niceMenu {
background: rgba(0, 0, 0, 0.8);
position: fixed;
top: 0;
ronaldroe / pmft.js
Last active Aug 29, 2015
The Poor Man's FitText
View pmft.js
/* Requires jQuery
** Include this file or copy/paste into your document.
** Call the function, passing the selector as a jQuery-style string.
** Offset is a number used to keep the text just short of the width of the parent to avoid rounding errors that will wrap the text.
** You can use the offset to adjust how close you want the width to be. Offset is optional and defaults to 10.
** Step defines the increase in font size. If you find one or more of your elements pushes out further than the others, adjust this
** number.
** For this to work, the element containing the text must be set to display:inline or inline-block, and the parent should be anything
** other than inline. So, if you have an h1 inside a header, you will need to make sure the h1 is inline or inline-block and the header
** isn't inline.