Skip to content

Instantly share code, notes, and snippets.

Avatar

Ronald Roe ronaldroe

View GitHub Profile
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
ronaldroe / cloudSettings
Created Oct 31, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-10-31T18:05:50.635Z","extensionVersion":"v3.2.0"}
@ronaldroe
ronaldroe / Gruntfile.js
Created Mar 8, 2016
My Wordpress Theme Dev Grunt Setup
View Gruntfile.js
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist:{
options: {
style: 'expanded',
compass: true
@ronaldroe
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
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.
You can’t perform that action at this time.