Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
filter: 'all',
init: function () {
this._super();
Ember.run.schedule("afterRender",this,function() {
this.updateSortable();
<samlp:AuthnRequest AssertionConsumerServiceURL="http://ruby-saml-example.herokuapp.com/saml/consume"
Destination="https://ec2-54-235-224-165.compute-1.amazonaws.com:9443/samlsso"
ID="_2D729750-3EB6-43A4-8416-938C7114D8C6"
IssueInstant="2013-03-12T16:25:08"
Version="2.0"
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
ruby-saml-example.herokuapp.com
</saml:Issuer>
</samlp:AuthnRequest>
@zdennis
zdennis / match_all.rb
Created August 10, 2012 15:24 — forked from sw17ch/match_all.rb
String#match_all :: Like String#scan but returns array of MatchData objects instead. (ruby 1.9-ified)
class String
# This method will return an array of MatchData's rather than the
# array of strings returned by the vanilla `scan`.
def match_all(regex)
match_str = self
[].tap do |match_datas|
while md = match_str.match(regex)
match_datas << md
match_str = md.post_match
@zdennis
zdennis / blerg.coffee
Created May 3, 2012 16:55 — forked from searls/blerg.coffee
refactoring blerg.coffee
window.app = format: {}
app.format.DollarizesCents = ->
dollarize: (pennies) ->
amount = (pennies / 100.0).toFixed(2)
[dollars, cents] = amount.toString().split(".")
"$#{@commasFor(dollars)}.#{cents}"
#private
commasFor: (dollars) ->
describe MyCustomerAdapter do
should_support_adapter_interface :create
should_support_adapter_interface :delete
end
# When I run the specs above, the following error occurs:
$ script/spec -c spec/controllers/strange_name_error.rb
./spec/controllers/strange_name_error.rb:15: undefined local variable or method `properties_url' for #<Class:0x22b918c> (NameError)
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:68:in `module_eval'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:68:in `create_nested_example_group'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/extensions/class.rb:14:in `instance_eval'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/extensions/class.rb:14:in `subclass'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:66:in `create_nested_example_group'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:53:in `describe'