This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Smple | |
| <pre> | |
| "@output_buffer = output_buffer || ActionView::OutputBuffer.new;@output_buffer.safe_append='Word.\n\n'.freeze;@output_buffer.append= link_to \"/rails/sucks\" do @output_buffer.safe_append='\n hallo\n'.freeze; end \n@output_buffer.safe_append='\n'.freeze;@output_buffer.to_s" | |
| </pre> | |
| ActionView::Template::Handlers::Erubis.new "<%= form_for Object.new do %>\n <%= link do %>hallo<% end %> \n<% end %>" | |
| ```ruby |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <snippet> | |
| <content><![CDATA[ | |
| {% highlight ruby %} | |
| ${1:this} | |
| {% endhighlight %} | |
| ]]></content> | |
| <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
| <tabTrigger>high</tabTrigger> | |
| <!-- Optional: Set a scope to limit where the snippet will trigger --> | |
| <!-- <scope>source.python</scope> --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <snippet> | |
| <content><![CDATA[ | |
| puts "@@@@@ #{${1:what}.inspect}"${2} | |
| ]]></content> | |
| <!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
| <tabTrigger>puts</tabTrigger> | |
| <!-- Optional: Set a scope to limit where the snippet will trigger --> | |
| <scope>source.ruby</scope> | |
| </snippet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Ruby Wishlist | |
| ## Removals | |
| * finalize! method for classes | |
| * Remove constant_finding/loading at runtime, it always breaks. | |
| ## Module.freeze | |
| Remove the ability to dynamically change code at runtime |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'benchmark' | |
| definition = {:title => "Lunch"} | |
| class DecoratorWithMethod | |
| def initialize(definition) | |
| @definition = definition | |
| end | |
| def [](value) | |
| @definition[value] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe "#inherit!" do | |
| # this would usually go in a before block and let and totally obfuscate what i wanna do: | |
| # also, this would be run once while the it blocks below are isolated. | |
| parent = Definitions.new([title, length]) | |
| child = Definitions.new([stars]) | |
| child.inherit!(parent) | |
| # make sure parent's definitions were cloned. | |
| # i'm fine with those it {} blocks: | |
| it { child.must_equal([stars, title, length]) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| staging: | |
| "default host" | |
| :http_asset_host: 'cdn%d.microminimus.com' | |
| :https_asset_host: 'cdn-microminimus.pantherssl.com' | |
| "local host" | |
| host: / | |
| only: fonts.css | |
| development: | |
| :http_asset_host: 'cdn%d.microminimus.com' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rsync -av . /media/nick/5EAD-07D0/NICK --exclude=*.cache/* --exclude=*.thumb*/* --exclude=*.rvm/* --modify-window=3601 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MiniTest::Assertions.class_eval do | |
| def assert_equal(subject, expected) | |
| subject == expected | |
| end | |
| end | |
| Array.infect_an_assertion :assert_hash, :must_be_hash, :do_not_flip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Here's the original problem: | |
| module Feature | |
| module ClassMethods | |
| def feature | |
| end | |
| end | |
| def self.included(includer) | |
| includer.extend ClassMethods |