Skip to content

Instantly share code, notes, and snippets.

View privatenumber's full-sized avatar

Hiroki Osame privatenumber

View GitHub Profile
@privatenumber
privatenumber / Navigation.md
Last active May 19, 2017 22:06
Navigation TAD

Navigation

<template>
	<o-navigation :links="links">

		<template slot="links" props="link">
			<nuxt-link :to="link.href">{{link.text}}</nuxt-link>
		</template>
(function BFS(obj, lookingFor, maxFinds = 100, maxDuration = 3) {
console.log('Traversing', obj, 'to find', lookingFor);
let findCount = 0;
let timedOut = false;
let queue = [[obj, '']];
setTimeout(() => (timedOut = true), maxDuration * 1000);
@privatenumber
privatenumber / requirejs.reload.js
Created July 7, 2016 06:11
Require.js "Watch" Implementation
var reload = (function () {
'use strict';
var cache = {};
var refresh = {};
var execCb = window.requirejs.s.contexts._.execCb;
window.requirejs.s.contexts._.execCb = function (name, callback) {