Skip to content

Instantly share code, notes, and snippets.

View robatron's full-sized avatar
🤖

Rob McGuire robatron

🤖
  • Zillow
  • Seattle, WA
View GitHub Profile
@robatron
robatron / client-store.md
Last active March 30, 2018 20:23
Storing and accessing server-side JSP variables for client-side JavaScript consumption via a custom JSP tag that uses HTML5 `localStorage`

Set server-side variables in your JSP template via a js:clientStore custom tag for consumption by the JavaScript:

<%-- Arbitrary JSP variables --%>
<c:set var="a" val="1" />
<c:set var="b" val="2" />
<c:set var="c" val="3" />

<%-- Store the "a" and "b" JSP variables under "my.namespace" --%>
<js:clientStore 
/*!
query-string
Parse and stringify URL query strings
https://github.com/sindresorhus/query-string
by Sindre Sorhus
MIT License
*/
(function () {
'use strict';
var queryString = {};
seta r_mode "-1"
seta r_customwidth "1920"
seta r_customheight "1080"
r_swapInterval "1"
@robatron
robatron / node.js
Last active February 29, 2016 18:10
class Node {
constructor( value = null, adjacents = [] ) {
this.value = value;
this.adjacents = adjacents;
}
toString ( ) {
return JSON.stringify( this );
}
}
/**
* Represents a hash table implemented on top of an array where each bucket is
* also an array.
*/
class HashTable {
// Create a new hash table instantiated with the table size, the size of
// the the array
constructor(tableSize) {}
@robatron
robatron / term-dash.md
Last active January 10, 2016 22:30
Terminal dashboarding tricks

Terminal Dashboard Notes

A few notes for creating a terminal-based dashboard

Example

function _dash_init () {
    tput civis
}
@robatron
robatron / clippy-error.sh
Created January 17, 2014 21:33
Clippy error message
if [ "$SEARCH_RESULT" != "" ]; then
echo " _ "
echo " / \ ___________________________________________ "
echo " | | / \ "
echo " @ @ | It looks like you are trying to | "
echo " || |/ | destroy the original repository! | "
echo " || || <--| Please create a fork, and try again. | "
echo " |\_/| | (And read the README while you're at it.) | "
echo " \___/ \___________________________________________/ "
@robatron
robatron / 0_reuse_code.js
Created December 10, 2013 22:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@robatron
robatron / gist:7900886
Last active December 30, 2015 23:29
{ "question":"How does the GitHub Gist API handle JSON metadata in the description field?", "tags": ["test tag 1", "test tag 2", "test tag 3"] }
test body