Skip to content

Instantly share code, notes, and snippets.

View benlesh's full-sized avatar
🐶
☕ 🔥 🔥 this is fine

Ben Lesh benlesh

🐶
☕ 🔥 🔥 this is fine
View GitHub Profile
@benlesh
benlesh / README.md
Last active August 29, 2015 14:03
Ember Computed Property Helpers

Ember Computed Property Helpers

More info at http://www.benlesh.com

Open license.. use however. EXCEPT THIS README, IF YOU USE THIS I'LL SUE.

/**
* @license AngularJS v1.3.0-local+sha.8548c99
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document, undefined) {'use strict';
/**
* @description
*
@benlesh
benlesh / date-parser-playing.js
Created August 15, 2014 19:25
Angular Date Parsing Hackery
console.clear();
var $locale = locale;
function forEach(coll, fn) {
var type = Object.prototype.toString.call(coll);
if(type === '[object Array]') {
//HACK new browsers only
coll.forEach(fn);
} else if(type === '[object Object]') {
@benlesh
benlesh / custom-circle.js
Last active August 29, 2015 14:06
Angular 1.3.0-beta.19 SVG custom element
/**
creates a circle in the upper left corner of its container
with the given radius. `<custom-circle radius="10"/>`
*/
app.directive('customCircle', function(){
return {
// the following two configuration options are
// required for SVG custom elements.
templateNamespace: 'svg',
replace: true,
@benlesh
benlesh / _web-workers.md
Last active August 29, 2015 14:06
dynamic-worker-blog-entry
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/rxjs/2.3.22/rx.all.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
body {
font-family: Sans-serif;
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/rxjs/2.3.22/rx.all.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<h1>Just say something</h1>
<script id="jsbin-javascript">
<h3>{{title}}</h3>
{{multline-graph dataSourceName="NetflixFancyData"
otherThings="wee" whatNow="whatever"
brushAction="brush"}}
@benlesh
benlesh / demo.hbs
Last active August 29, 2015 14:17
Help me obi-bryn kenobi... you're my only hope
I have a table component that works like this (basically):
{{#nf-table data=someData}}
{{#nf-column}}
{{#nf-header}}Foo{{/nf-header}}
{{#nf-cell}}<button {{action 'fooClicked'}}>{{foo}}</button>{{/nf-cell}}
{{/nf-column}}
{{#nf-column}}
{{#nf-header}}Bar{{/nf-header}}
{{#nf-cell}}{{bar}}{{/nf-cell}}
@benlesh
benlesh / gist:ab8517a54b3e39b196ae
Created March 30, 2015 17:32
Generator Return Values are Weird
window.console.clear();
function* gen1() {
yield 1;
yield 2;
return 3;
}
function printForOf(iter) {
for(var x of iter) {