Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View agarrharr's full-sized avatar
📱

Adam Garrett-Harris agarrharr

📱
View GitHub Profile
@agarrharr
agarrharr / eventcmd.rb
Created December 11, 2014 06:05
Save Pianobar songs to firebase and file
#!/usr/bin/ruby
require 'cgi'
trigger = ARGV.shift
if trigger == 'songstart'
songinfo = {}
STDIN.each_line { |line| songinfo.store(*line.chomp.split('=', 2))}
@agarrharr
agarrharr / pianobar.html
Created February 21, 2015 16:23
Pianobar Widget Using Firebase
<div class="widget">
<h3>Currently Listening To</h3>
<div id="pianobar">
<div id="pianobarSong"></div>
<div id="pianobarArtist"></div>
<div id="pianobarAlbum"></div>
</div>
</div>
<script>
var ref = new Firebase("https://blazing-fire-5020.firebaseio.com/currentSong");
@agarrharr
agarrharr / feed.xml
Created February 27, 2015 01:58
Jekyll Rss Feed
---
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.title }}</title>
<description>{{ site.description }}</description>
<link>{{ site.url }}</link>
<atom:link href="{{ site.url }}/feed.xml" rel="self" type="application/rss+xml" />
{% for post in site.posts limit:10 %}
@agarrharr
agarrharr / d3.chart.min.js
Created June 5, 2015 22:01
d3.chart Circles
/*! d3.chart - v0.2.1
* License: MIT Expat
* Date: 2014-06-24
*/
(function(t){"use strict";function e(t){var e,r,n,i;if(!t)return t;for(r=arguments.length,e=1;r>e;e++)if(n=arguments[e])for(i in n)t[i]=n[i];return t}var r=t.d3,n=Object.hasOwnProperty,i=function(t,e){if(!t)throw Error("[d3.chart] "+e)};i(r,"d3.js is required"),i("string"==typeof r.version&&r.version.match(/^3/),"d3.js version 3 is required");var a=/^(enter|update|merge|exit)(:transition)?$/,s=function(t){i(t,"Layers must be initialized with a base."),this._base=t,this._handlers={}};s.prototype.dataBind=function(){i(!1,"Layers must specify a `dataBind` method.")},s.prototype.insert=function(){i(!1,"Layers must specify an `insert` method.")},s.prototype.on=function(t,e,r){return r=r||{},i(a.test(t),"Unrecognized lifecycle event name specified to `Layer#on`: '"+t+"'."),t in this._handlers||(this._handlers[t]=[]),this._handlers[t].push({callback:e,chart:r.chart||null}),this._base},s.prototype.off=function(t,e){var r,n=this._handlers[t];if(i(a.
@agarrharr
agarrharr / index.html
Last active August 29, 2015 14:22
Reorder the Dom
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg height="200px" width="200px">
<circle cx="100" cy="100" r="50" style="fill: #0091EA"></circle>
<circle cx="150" cy="100" r="50" style="fill: #00C853"></circle>
</svg>
<script>
@agarrharr
agarrharr / index.html
Last active August 29, 2015 14:22
Reorder the Dom II
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<svg height="500px" width="500px">
<circle cx="100" cy="100" r="50" style="fill: #0091EA"></circle>
<circle cx="150" cy="100" r="50" style="fill: #00C853"></circle>
</svg>
<script>
@agarrharr
agarrharr / index.md
Last active October 11, 2017 17:00
React/Redux Code Style

React/Redux Code Style

Redux

General

  • Store the minimum amount of data necessary to describe the entire state of the app
  • Use selectors to derive information from the store

Directory Structure

@agarrharr
agarrharr / feed.rss
Last active October 21, 2017 06:29
Jekyll Podcast Feed
---
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>{{ site.title }}</title>
<description>{{ site.description }}</description>
<link>{{ site.url }}</link>
<language>en</language>
<managingEditor>{{ site.managerName }} ({{ site.managerEmail }})</managingEditor>

Keybase proof

I hereby claim:

  • I am agarrharr on github.
  • I am agarrharr (https://keybase.io/agarrharr) on keybase.
  • I have a public key ASAHqzkxr1n0N1OgZ8ft27nVSNVj7OoAYLPMKei5I7vKxAo

To claim this, I am signing this object:

@agarrharr
agarrharr / comments.md
Last active April 3, 2018 16:21
comments.js
- /*
- console.log('commented')
- /**/
+ //*
+ console.log('uncommented')
+ /**/