Skip to content

Instantly share code, notes, and snippets.

Daniel Olano olanod

Block or report user

Report or block olanod

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@olanod
olanod / Makefile
Created Apr 27, 2017
Go makefile with cross compilation
View Makefile
default: build
OS=$(shell uname | tr [:upper:] [:lower:])
PLATFORMS=linux darwin freebsd
PKG_NAME=$(shell glide name)
APP_NAME=$(shell basename $(PKG_NAME))
APP_VERSION=$(shell git describe --tags --always)
BRANCH?=$(shell git rev-parse --abbrev-ref HEAD)
BUILD_DIR?=build
@olanod
olanod / templates.js
Last active Jun 25, 2018
Simple template loader. A global object that loads and caches templates.
View templates.js
const templates = Object.create(null, {
load: {
value: async function(fileName) {
const url = new URL(fileName,
document.currentScript && document.currentScript.src || location.href)
if (url in this) return this[url]
// fetch and parse template as string
let template = await fetch(url)
template = await template.text()
template = new DOMParser().parseFromString(template, 'text/html')
@olanod
olanod / EventEmitter.js
Created Jan 12, 2016
Super simple and elegant implementation of an event emitter that follows the EventTarget interface of browsers using ES6 goodness.
View EventEmitter.js
// store for private variables
let _ = new WeakMap();
/**
* Event emitter following browser's EventTarget interface
*/
export class EventEmitter {
constructor() {
_.set(this, { callbacks: new Map() });
@olanod
olanod / recursive-list.js
Last active Oct 8, 2015
Recursive HTML List
View recursive-list.js
var navigation = createList(globalDataSet);
/**
* Create an HTML list from a tree-like data set
* @param {Array} data Recursive array
* @return {HTMLUListElement} Unordered list with the recursive set of children
*/
function createList(data) {
var listElement = createListElement();
You can’t perform that action at this time.