Skip to content

Instantly share code, notes, and snippets.

@rauhryan
rauhryan / intro.md
Last active August 29, 2015 14:13
HuBoard (gif edition)

#HuBoard (gif edition)

Drag and drop between columns

Drag between milestones

@cowboyd
cowboyd / mutable-collection.js
Created March 26, 2015 14:59
Present a mutable interface to an immutable array and track changes in realtime
import Ember from 'ember';
/**
* Presents a mutable interface to an immutable array.
*
* As you make changes to the array, it tracks which objects are new,
* which objects have been removed, and which objects were in the
* original array. To use an instance of this class, set the
* `original` property to an array. This array will not be touched as
* you make changes via the mutable interface. E.g.
@rauhryan
rauhryan / chads.cs
Created October 25, 2011 15:08
Future AST post
public int add(int a, int b)
{
return a + b;
}
public int subtract(int a, int b)
{
return a - b;
}
@nathansmith
nathansmith / data_icon.css
Created December 14, 2011 15:26
Terse Font Icons
a[data-icon]:before,
span[data-icon]:before {
font-family: 'Icon Font Here';
content: attr(data-icon);
}
/*
This would also work, but other web developers might
yell at you about "performance" which may/not matter:
@lancejpollard
lancejpollard / index.md
Created May 22, 2012 06:32
Notes on Ember.js overcomplicating...

Some random notes on the pangs of ember. Will be expanding as they are uncovered.

Building a form

Say you have a form that maps to a model, something like:

<form>
  <fieldset>
    <legend>Who are you?</legend>
@bru
bru / Gemfile
Created August 4, 2012 14:22
Sinatra HStore setup
source :rubygems gem "sinatra"
gem "pg" gem "activerecord-postgres-hstore"
gem "sinatra-activerecord"
@JEG2
JEG2 / struct.md
Created June 3, 2013 21:50
Thinking out loud about the merits and drawbacks of two different usages of Struct…

How Should We Use Struct?

The Choice

It's common in Ruby to see some code setup a Struct like this:

class Specialized < Struct.new(:whatever)
  # ... define custom methods here...
end
(function (global) {
"use strict";
function empty(obj) {
var key;
for (key in obj) if (obj.hasOwnProperty(key)) return false;
return true;
}
var Ember = global.Ember,
anonymous
anonymous / jsbin.orezos.html
Created August 7, 2013 18:44
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
@alexspeller
alexspeller / base64encode.js.coffee
Last active December 21, 2015 04:38
Ember Table Extensions
# So, this is pretty horrible. If we just encode using btoa, any UTF-8 chars cause an error.
# If we use either of the workarounds on MDN[1], the £ sign is encoded wrong. I suspect
# Excel totally sucking at encodings is the reason why. So, the workaround is, to use
# the MDN workaround on chars with values > 255, and allow chars 0-255 to be encoded
# as is with btoa. Note that if you use either of the workarounds on MDN, chars
# 128-255 will be encoded as UTF-8, which includeds the £ sign. This will cause excel
# to choke on these chars. Excel will still choke on chars > 255, but at least the £
# sign works now...
# [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding