Skip to content

Instantly share code, notes, and snippets.

View robatron's full-sized avatar
🤖

Rob McGuire robatron

🤖
  • Zillow
  • Seattle, WA
View GitHub Profile
/** Example module that supports CommonJS and IFFE modularity
*
* - CommonJS modules can be imported via `require`
* - IFFE modules attach themselves to the browser's window object
*/
;( function ( factory ) {
// If the environment supports CommonJS modules, attach module to `module.exports`
if ( typeof require === 'function' && typeof exports === 'object' && typeof module === 'object' ) {
var target = module.exports || exports;

Kava Tea Recipe

A preparation method for a tasty cup of kava, a traditional Polynesian tea

Preparation time

~20 minutes

Ingredients

@robatron
robatron / spanikopita-recipe.md
Last active August 29, 2015 13:57
Recipe for spanikopita #recipe

Spanikopita

  • ½ lb frozen spinach
  • 2 cloves garlic, chopped
  • 1 lemon, zested
  • ¼ tsp. nutmeg
  • ½ cup feta, crumbled and/or
  • ¼ cup parmesan, finely grated.
  • ¼ cup toasted pine nuts (optional)
@robatron
robatron / tzaziki-recipe.md
Created March 21, 2014 20:57
Recipe for tzaziki #recipe

Tzaziki

  • 1 English cucumber
  • 1 container Greek yogurt
  • 1 bunch dill
  • 2 cloves garlic
  • 2-3 sprigs mint (optional)
  • Sea salt
@robatron
robatron / rei-logo.js
Last active August 29, 2015 14:00
Returns the REI logo in ASCII art, compressed using the LZW compression algorithm (744 bytes)
function d(r){for(var e,n={},t=(r+'').split(''),o=t[0],c=o,d=[o],a=256,h=1;
h<t.length;h++){var M=t[h].charCodeAt(0); e=256>M?t[h]:n[M]?n[M]:c+o,d.push(e),
o=e.charAt(0),n[a]=c+o,a++,c=e}return d.join('')}d('MĀāĂ㥹ĆćĈĉć\nĊčĎďĐăČđĔĕĖ'+
'ēĖęĚĈĘěĞğĝğĢėģĥĤĦĨďġĩĬąīĬ?ĭāįĉ..ZĐĶĶIJĴćĺ.Ď?ĿĶ:ĵŀĔĽąŃŇĈŋĀ ŌăłĶ~ đʼnă~MĿMıĆŐĿDă'+
'ĻĂĺťĐŘţŃľūąŐŏŦă+ŖčũāŋŤťŃ8ņŹŊĸĉŶśŸŹ7ŎIJĄŶ7:ƄĻƄ+ƐƑƐāƒƕƓĀƕĀżĮĎƍ.ŠƞŭƃƍŷŜM,$ƜčơƬƢơ'+
'ƥűċƫƭ+ŋIƣƱƢĄƺƪōƭĀƇƇƸŸưžƽƾƞDžƍŢǀljǍƱĆũƭŇơŴNJŬǐLJŊǓŀƬŪĺOǡǢǗĜĈƌǜŋŚŋ7NJǂƼƉǘǨŃŚǏűƯǵőǚƈ'+
'ƈƂǻĠǾȀǽȀĚȂȃħȆĭȅȈŗȋȉȍĬ')
/**
* LZW compression
* - https://gist.github.com/revolunet/843889
* - http://pieroxy.net/blog/pages/lz-string/index.html
*/
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
@robatron
robatron / rei-logo-ascii.txt
Created April 25, 2014 16:15
REI logo in ASCII art (2.67 KB)
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM?MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
@robatron
robatron / nested-node-package-dev.md
Last active August 29, 2015 14:01
Nested Node Package Development and Integration Testing

Nested Node Package Development and Integration Testing

How to actively develop and integration test a Node package within another Node package

Ideally, you'll want to develop your Node package in a self-contained way, thorugh unit testing and examples, independent from other packages. Sometimes, however, you'll want to develop your Node package within another package for integration testing purposes.

  1. From your package directory, run npm link. This will create a globally-installed symlink to your package.

     cd ~/code/my-package
    

npm link

@robatron
robatron / kirby-prompt.sh
Last active August 29, 2015 14:04
Make kirby dance in your command prompt
# Add this to your .bashrc/.profile to make Kirby dance in your command prompt! E.g.,
#
# rob@hal ~ $ (>'.')>
# rob@hal ~ $ ^('.')^
# rob@hal ~ $ <('.'<)
# rob@hal ~ $ ^('.')^
# rob@hal ~ $ (>'.')>
#
# Moved from it's original location at http://pastebin.com/ftR6mtPg
@robatron
robatron / kirby-js-console-dance.js
Last active August 29, 2015 14:04
Make Kirby dance in your browser's JavaScript console.
/**
* Make Kirby dance in your browser's JavaScript console.
*
* Great to run in your coworker's console when they forget to lock their computer.
*/
var i = 0;
var KFRAMES = [ "<('.'<)", "^('.')^", "(>'.')>", "^('.')^" ];
setInterval( function () {
clear();
console.log( KFRAMES[ i % ( KFRAMES.length - 1 ) ] );