I hereby claim:
- I am jtrim on github.
- I am jessetrimble (https://keybase.io/jessetrimble) on keybase.
- I have a public key whose fingerprint is F91C 3D5D 83BC 3B4B ED30 0A77 85F2 9CB2 647D 8801
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| Function.prototype.call = function() { return "NO" } |
| ==== | |
| !!!! | |
| ========================== | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
| || _____ _____ || | |
| || | | | | | | || | |
| || |-|-| |-|-| || | |
| || ##### ##### || |
| # The following is a possible way we can express conditionals in templates that | |
| # are written to be rendered *both* by Rails and for the front-end in Mustache. | |
| # | |
| # ```haml | |
| # - task.if 'assignee' do | |
| # %label.subtle 'assigned to' | |
| # = task.assignee_name | |
| # | |
| # - task.unless 'assignee' do | |
| # %label.subtle 'not assigned' |
| # /app/models/foo.rb | |
| class Foo < ActiveRecord::Base | |
| validates_format_of :zip, with: /^[0-9]{5}$/, message: 'must be a valid 5-digit ZIP' | |
| end | |
| # /spec/models/foo_spec.rb | |
| require 'spec_helper' | |
| describe Foo do | |
| describe 'validations' do | |
| it { should_not allow_value("12345\n12345").for(:zip) } |
| # Dasherizes a string | |
| # | |
| # Usage: | |
| # | |
| # _.dasherize("Foo_Bar") #=> 'foo-bar' | |
| # _.dasherize("FooBar") #=> 'foo-bar' | |
| # _.dasherize("foo_bar") #=> 'foo-bar' | |
| # _.dasherize("foo-bar_Baz") #=> 'foo-bar-baz' | |
| # | |
| dasherize: (string) -> |
| class ApplicationController < ActionController::Base | |
| # ... | |
| def default_url_options | |
| { :format => :html } | |
| end | |
| end |
| #!/usr/bin/env ruby | |
| image_data = IO.read('test.png') | |
| pngquant_io = IO.popen('pngquant 16') | |
| pngquant_io.write image_data | |
| pngquant_io.close_write | |
| processed_data = pngquant_io.read |
| <a href="javascript:window.open('http://rubydoc.info/gems/' + prompt('Gem name:') + '/frames');">Gem Docs</a> |
| # config/initializers/haml.rb | |
| Haml::Template.options[:ugly] = true |