Skip to content

Instantly share code, notes, and snippets.

Ryan Rauh rauhryan

Block or report user

Report or block rauhryan

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
@rauhryan
rauhryan / intro.md
Last active Aug 29, 2015
HuBoard (gif edition)
View intro.md

#HuBoard (gif edition)

Drag and drop between columns

Drag between milestones

@cowboyd
cowboyd / mutable-collection.js
Created Mar 26, 2015
Present a mutable interface to an immutable array and track changes in realtime
View mutable-collection.js
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 Oct 25, 2011
Future AST post
View chads.cs
public int add(int a, int b)
{
return a + b;
}
public int subtract(int a, int b)
{
return a - b;
}
View data_icon.css
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
Notes on Ember.js overcomplicating...
View index.md

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 Aug 4, 2012
Sinatra HStore setup
View Gemfile
source :rubygems gem "sinatra"
gem "pg" gem "activerecord-postgres-hstore"
gem "sinatra-activerecord"
@JEG2
JEG2 / struct.md
Created Jun 3, 2013
Thinking out loud about the merits and drawbacks of two different usages of Struct…
View struct.md

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
View buffered_proxy.js
(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,
View jsbin.orezos.html
<!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 Dec 21, 2015
Ember Table Extensions
View base64encode.js.coffee
# 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
You can’t perform that action at this time.