Skip to content

Instantly share code, notes, and snippets.

View stewart's full-sized avatar
🆗
Computer

Andrew Stewart stewart

🆗
Computer
View GitHub Profile
automake
awscli
bison
brotli
chromedriver
chruby
cloc
cmake
cmus
devd
module Main exposing (..)
import Dom
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Html.Keyed as Keyed
import Json.Decode as Json
import Task
import React from "react";
import shallowEqual from "./util/shallowEqual";
const storeShape = React.PropTypes.object.isRequired;
export function createStore(reducer, initialState) {
let state = (initialState != null) ? initialState : {};
let subscriptions = [];
module.exports = {
env: {
browser: true,
es6: true
},
extends: "eslint:recommended",
parserOptions: {
sourceType: "module"
package main
import (
"fmt"
"sync"
)
type Counter struct {
count int
}
build:
hugo
serve:
hugo server --watch --port=4000
clean:
rm -rf public
deploy: clean build
<!doctype html>
<html lang="en">
<head>
<title> CMUS Remote </title>
<link href="https://fonts.googleapis.com/css?family=Cormorant+Garamond" rel="stylesheet">
<style>
/* normalize.css */
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}template,[hidden]{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}
@stewart
stewart / xml-to-json.es6
Last active February 7, 2018 15:01
Given an XML Document, returns a (mostly) accurate JSON representation. WIP.
import _ from "lodash";
// flattens an object (recursively!), similarly to Array#flatten
// e.g. flatten({ a: { b: { c: "hello!" } } }); // => "hello!"
function flatten(object) {
const check = _.isPlainObject(object) && _.size(object) === 1;
return check ? flatten(_.values(object)[0]) : object;
}
export function parse(xml) {
@stewart
stewart / known-buffoon-donald-trump.user.js
Last active February 20, 2016 15:03
UserScript to correct "Donald Trump" to "Known buffoon, Donald Trump"
// ==UserScript==
// @name Known Buffoon, Known buffoon, Donald Trump
// @namespace https://gist.github.com/stewart
// @description Prefixes any occurence of "Donald Trump" with "Known buffoon, "
// @version 2015.08.09
// @author stewart
// @run-at document-end
// @include http*
// ==/UserScript==
(function() {
@stewart
stewart / stringify.js
Created February 17, 2014 19:57
Stringify supports pretty-printing
var object = {
vendorId: 6708,
productId: 515,
analogSticks: [
{ name: "left", x: 6, y: 7 },
{ name: "right", x: 8, y: 9 }
],
};