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
| # Evil Exponential Backoff | |
| # | |
| # fog has this wait_for method that calls #to_f on its interval each iteration | |
| # to determine how to sleep. https://github.com/fog/fog/blob/master/lib/fog/core/wait_for.rb | |
| # | |
| # This object will generate the 2**n series. Each time you call to_f, it'll give you another one. | |
| # | |
| iter = (0..(1/0.0)).each | |
| def iter.to_f |
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
| // Generated from test_shatner.mirah | |
| package org.shatner; | |
| public class SomeAppWithAnUnmacroedView extends org.shatner.ShatnerBase { | |
| public SomeAppWithAnUnmacroedView() { | |
| org.shatner.SomeAppWithAnUnmacroedView.__xform_tmp_5 $binding = new org.shatner.SomeAppWithAnUnmacroedView.__xform_tmp_5(); | |
| java.lang.String temp$1 = null; | |
| { | |
| temp$1 = "/"; | |
| } | |
| org.shatner.SomeAppWithAnUnmacroedView.__xform_tmp_6 temp$2 = new org.shatner.SomeAppWithAnUnmacroedView.__xform_tmp_6($binding); |
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
| def foo r:Runnable | |
| #... | |
| end | |
| foo do # Block 1. | |
| foo do # Block 2. | |
| puts 1 | |
| end | |
| end |
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
| /Users/nick/hacking/mirah_model/test/model_test.mirah:31: Bad unquote value | |
| property 'date', Date | |
| ^^^^^^^^^^^^^^^^^^^^^^^ | |
| rake aborted! | |
| Bad unquote 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
| macro def add_puts_to_init str_node | |
| puts_tree = quote do | |
| puts `str_node` | |
| end | |
| init_method = caller.containing_class.method :initialize | |
| unless init_method | |
| caller.containing_class.body << quote do | |
| def initialize | |
| end |
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
| $ rvm install --trace macruby-0.9 | |
| --trace macruby-0.9 | |
| rvm 1.10.2 by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/] | |
| + /scripts/cli : __rvm_parse_args() 738 > [[ -n '' ]] | |
| + /scripts/cli : __rvm_parse_args() 739 > export 'PS4=+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > ' | |
| + /scripts/cli : __rvm_parse_args() 739 > PS4='+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > ' | |
| + /scripts/cli : __rvm_parse_args() 770 > [[ -z install ]] | |
| + /scripts/cli : __rvm_parse_args() 772 > [[ 0 -eq 1 ]] |
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
| # USAGE: Hash.from_xml:(YOUR_XML_STRING) | |
| # | |
| # - fixes handling of <text> elements | |
| # - prepends namespaces on keys where used including both elements & attributes | |
| # - uses strings instead of symbols to prevent consumption of the symbol table | |
| require 'nokogiri' | |
| # modified from http://stackoverflow.com/questions/1230741/convert-a-nokogiri-document-to-a-ruby-hash/1231297#1231297 | |
| class Nokogiri::XML::Node | |
| def namespaced_name |
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
| --- !map:HashWithIndifferentAccess | |
| body: other test comment body | |
| type: test |
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 to wrap tests with ActiveRecord db transactions outside Rails. | |
| # | |
| # references: | |
| # https://github.com/rails/rails/blob/master/railties/lib/rails/test_help.rb#L27 | |
| # https://github.com/rails/rails/blob/master/activerecord/lib/active_record/fixtures.rb#L704 | |
| # | |
| # TestFixtures checks whether configurations is blank | |
| # to determine whether to use transactions/fixtures or not. | |
| # which is why we need to set it to something. | |
| ActiveRecord::Base.configurations= {test: { |
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 'rubygems' | |
| require 'em-http-request' | |
| # Monkey-patched Gzip Decoder to handle | |
| # Gzip streams. | |
| # | |
| # This takes advantage of the fact that | |
| # Zlib::GzipReader takes an IO object & | |
| # reads from it as it decompresses. | |
| # |