Run $ ruby logo.rb in a directory with rip.txt.
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
| # comment | |
| _true = true | |
| _false = false | |
| integer = 42 | |
| rational = 3.14 | |
| rational = 2 / 3 | |
| complex = integer + decimal.i |
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
| var gulp = require('gulp'); | |
| var clean = require('gulp-clean'); | |
| var replace = require('gulp-replace'); | |
| var zip = require('gulp-zip'); | |
| var jshint = require('gulp-jshint'); | |
| var stylish = require('jshint-stylish'); |
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
| module StepHelpers | |
| def table_for(table_or_id) | |
| if table_or_id.is_a?(Capybara::Node::Element) | |
| table_or_id | |
| else | |
| find("##{table_or_id}") | |
| end | |
| end | |
| def row_containing_text(table_or_id, text) |
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
| $ ./bin/rip repl | |
| Welcome to Rip | |
| Type "help" for help, "exit" to quit | |
| [1] module> add = -> (a, b) { a + b } | |
| => #< #< System.Lambda > [ bind, class ] keyword = ->, arity = 2 > | |
| [2] module> add5 = add(5) | |
| => #< #< System.Lambda > [ bind, class ] keyword = ->, arity = 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
| ## | |
| # Constants | |
| System.Math.i # square root of -1 | |
| System.Math.PI # 5 decimal points (same as `System.Math.PI_to(5)`, but only calculated once) | |
| System.Math.PI_to # lambda that calculates a decimal to `n` decimal points | |
| ## | |
| # Real Numbers |
When rendering tags |> join(', '), join(', ') would be evaluated first. Next the tags would be passed into whatever join(', ') returns, which is expected to be a function that excepts a single argument.
Essentially this gets transformed (logically at least) into join(', ')(tags), which is equivalent to join(', ', tags).
!!! I HAVEN'T RUN THIS CODE !!!
Refactor of Caleb Wood's module approach to static lists in Rails to extract StaticList from Greeting.
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
| From: /Users/simpsonj/products/usage_meter/app/models/price_book.rb @ line 3 : | |
| 1: class PriceBook | |
| 2: # include Anima.new(:id, :name, :codes) | |
| => 3: binding.pry | |
| 4: | |
| 5: def price_for_code(code) | |
| 6: codes[code] | |
| 7: end |
I hereby claim:
- I am ravinggenius on github.
- I am ravinggenius (https://keybase.io/ravinggenius) on keybase.
- I have a public key whose fingerprint is 71D5 A324 4D7D 3154 C739 DE3F EB95 0C85 C160 4EAB
To claim this, I am signing this object: