Skip to content

Instantly share code, notes, and snippets.

View kad3nce's full-sized avatar

Jedidiah Hurt kad3nce

View GitHub Profile
@kad3nce
kad3nce / ch5.md
Created March 21, 2014 14:36
# You Don't Know JS: Scope & Closures

You Don't Know JS: Scope & Closures

Chapter 5: Scope Closure

We arrive at this point with hopefully a very healthy, solid understanding of how scope works.

We turn our attention to an incredibly important, but persistently elusive, almost mythological, part of the language: closure. If you have followed our discussion of lexical scope thus far, the payoff is that closure is going to be, largely, anti-climatic, almost self-obvious. There's a man behind the wizard's curtain, and we're about to see him. No, his name is not Crockford!

If however you have nagging questions about lexical scope, now would be a good time to go back and review Chapter 2 before proceeding.

Enlightenment

@kad3nce
kad3nce / README.md
Created March 31, 2014 14:34
#Restangular

#Restangular

Build Status PayPayl donate button Donate on Gittip

Restangular is an AngularJS service that simplifies common GET, DELETE, and UPDATE requests with a minimum of client code.

@kad3nce
kad3nce / poetry.js
Created April 8, 2014 17:59
function poetry(packet) {
function poetry(packet) {
_.pipeline(_.accessor('seed'), doit)(JSON.parse(packet));
}
var t = 0;
var n = 0;
var paths = 0;
var above='brow,mist,shape,layer,the crag,stone,forest,height'.split(',');
var below='flow,basin,shape,vein,rippling,stone,cove,rock'.split(',');
@kad3nce
kad3nce / baseplate-post.md
Last active August 29, 2015 14:14
DIY Builds: Baseplate With Built-In Shoulder Pad

Finished Baseplate

This is a guest post by Jake Schumacher & Jed Hurt

We're working on an ambitious doc called App: The Human Story. With a crowdfunded budget, we have to find ways to stretch every dollar.

The new breed of baseplates-that-double-as-shoulder-rigs is incredibly versatile, comfortable to use, and not very easy on your wallet. Don’t fret though. With a little DIY spirit, you can make your own for a fraction of the price.

Let’s start by defining the three features we're after:

@kad3nce
kad3nce / ch3.md
Created April 3, 2015 15:28
# You Don't Know JS: ES6 & Beyond

You Don't Know JS: ES6 & Beyond

Chapter 3: Organization

Some of the most important changes in ES6 involve improved support for the patterns we already commonly use to organize JavaScript functionality. This chapter will explore Iterators, Generators, Modules, and Classes.

Iterators

An iterator is a structured pattern for pulling information from a source in one-at-a-time fashion. This pattern has been around programming for a long time. And to be sure, JS developers have been ad hoc designing and implementing iterators in JS programs since before anyone can remember, so it's not at all a new topic.

What ES6 has done is introduce an implicit standardized interface for iterators. Many of the built in data structures in JavaScript will now expose an iterator implementing this standard. And you can also construct your own iterators adhering to the same standard, for maximal interoperability.

@kad3nce
kad3nce / crash.log
Created May 2, 2015 17:22
Terraform 0.4.2 Crash Report
2015/05/02 11:18:35 [INFO] Terraform version: 0.4.2 8175d7f82134d378234a407e529853da681af07e+CHANGES
2015/05/02 11:18:35 Detected home directory from env var: /Users/jedidiah
2015/05/02 11:18:35 [DEBUG] Discovered plugin: atlas = /usr/local/bin/terraform/terraform-provider-atlas
2015/05/02 11:18:35 [DEBUG] Discovered plugin: aws = /usr/local/bin/terraform/terraform-provider-aws
2015/05/02 11:18:35 [DEBUG] Discovered plugin: cloudflare = /usr/local/bin/terraform/terraform-provider-cloudflare
2015/05/02 11:18:35 [DEBUG] Discovered plugin: cloudstack = /usr/local/bin/terraform/terraform-provider-cloudstack
2015/05/02 11:18:35 [DEBUG] Discovered plugin: consul = /usr/local/bin/terraform/terraform-provider-consul
2015/05/02 11:18:35 [DEBUG] Discovered plugin: digitalocean = /usr/local/bin/terraform/terraform-provider-digitalocean
2015/05/02 11:18:35 [DEBUG] Discovered plugin: dme = /usr/local/bin/terraform/terraform-provider-dme
2015/05/02 11:18:35 [DEBUG] Discovered plugin: dnsimple = /usr/local/bin/terraform/te
@kad3nce
kad3nce / page-scroller.js
Last active November 12, 2015 18:53
Automatic Page Scroller
var scrollElement = function (element, scrollDistance, scrollDuration) {
var style = element.style;
// setup CSS transition duration and easing function
style.webkitTransition =
style.transition = scrollDuration + 's';
style.webkitTransitionTimingFunction =
style.TransitionTimingFunction = 'ease-in-out';
// use translate3d to force hardware acceleration

Keybase proof

I hereby claim:

  • I am kad3nce on github.
  • I am jhurt (https://keybase.io/jhurt) on keybase.
  • I have a public key ASBg-qSocU-E2BtkC8vAs7wsKFlO6chnu-DtmY79f3MptAo

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Test</title>
</head>
<body>
<div class="pigeonhole-iframe"></div>
<script type="text/javascript">
(function(p,i,g,e,o,n,s){p[o]=p[o]||function(){(p[o].q=p[o].q||[]).push(arguments)},