Skip to content

Instantly share code, notes, and snippets.

View ravinggenius's full-sized avatar
🤔
likely thinking

Thomas Ingram ravinggenius

🤔
likely thinking
View GitHub Profile
# comment
_true = true
_false = false
integer = 42
rational = 3.14
rational = 2 / 3
complex = integer + decimal.i
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');
@ravinggenius
ravinggenius / step_helpers.rb
Last active August 29, 2015 14:01
Helpers for dealing with tables when integration testing with Capybara
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)
@ravinggenius
ravinggenius / session.txt
Created May 15, 2014 02:20
First Rip REPL session
$ ./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 >
@ravinggenius
ravinggenius / numbers.rip
Last active August 29, 2015 14:01
Literal syntaxes for different types of number in Rip
##
# 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
@ravinggenius
ravinggenius / README.md
Created May 9, 2014 15:17
Curry example

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).

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

Keybase proof

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:

(function (global) {
global.awesomification = function (includeSpeech) {
var log = console.log;
console.log = function (str) {
var css = 'background: linear-gradient(to right, red, yellow, lime, aqua, blue, fuchsia, red); color: white; font-weight: bold; text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;';
var args = Array.prototype.slice.call(arguments);
args[0] = '%c' + args[0];
args.splice(1, 0, css);