Skip to content

Instantly share code, notes, and snippets.

View jhyland87's full-sized avatar

J jhyland87

View GitHub Profile
@jhyland87
jhyland87 / style-guide.js
Last active September 30, 2016 15:41 — forked from rwaldron/style-guide.js
Writing Idiomatic JavaScript
// 1. Two space soft indents (fake tabs) OR tabs... BUT NEVER BOTH - DO NOT MIX
// 2. Whitespace, Parens, Braces, Linebreaks
// if/else/for/while/try always have spaces, braces and multiple lines.
--------------------------------------------------------------------
@jhyland87
jhyland87 / awklib.awk
Created January 30, 2017 19:50 — forked from edwardbadboy/awklib.awk
useful awk functions
function qsort(A, left, right, i, last) {
if (left >= right)
return
last = left
for (i = left+1; i <= right; i++)
if (A[i] < A[left])
swap(A, ++last, i)
swap(A, left, last)
qsort(A, left, last-1)
qsort(A, last+1, right)
@jhyland87
jhyland87 / dialog.html
Created June 7, 2017 06:09 — forked from arthurattwell/dialog.html
Google Sheets script to allow multi-select in cells with data-validation (adapted from https://www.youtube.com/watch?v=dm4z9l26O0I)
<div style="font-family: sans-serif;">
<? var data = valid(); ?>
<form id="form" name="form">
<? if(Object.prototype.toString.call(data) === '[object Array]') { ?>
<? for (var i = 0; i < data.length; i++) { ?>
<? for (var j = 0; j < data[i].length; j++) { ?>
<input type="checkbox" id="ch<?= '' + i + j ?>" name="ch<?= '' + i + j ?>" value="<?= data[i][j] ?>"><?= data[i][j] ?><br>
<? } ?>
<? } ?>
<? } else { ?>