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
@ravinggenius
ravinggenius / url.rip
Last active October 6, 2016 16:26
Resolve with current Rip semantics
URL = class {
@.initialize = => {
-> (scheme, user, password, host, port, path, query, fragment) {
@.scheme = scheme
@.user = user
@.password = password
@.host = host
@.port = port
@.path = path
@.query = query
@ravinggenius
ravinggenius / dabblet.css
Created December 15, 2014 20:01 — forked from LeaVerou/dabblet.css
HSL clock
/**
* HSL clock
*/
height: 100%;
font: bold 5em/1 Helvetica Neue, sans-serif;
display: flex;
text-align: center;
align-items: center;
justify-content: center;
[1] module > foo = -> (a, b, c) { a + b + c }
=> {
-> (a<#< System.Object >>, b<#< System.Object >>, c<#< System.Object >>) { ... }
}
[2] module > foo4 = foo(4)
=> {
-> (b<#< System.Object >>, c<#< System.Object >>) { ... }
}
test = System.require('test')
test.group('group name', -> (t) {
t.test('test name', -> (t) {
t.expect(1 + 1) toEqual 2
})
t.test('failing test', -> (t) {
t.expect(1 + 1) toEqual 1
})
@ravinggenius
ravinggenius / README.md
Last active August 29, 2015 14:08
Type restrictions, multi-types, generics

Types And Signatures

All objects have a single .type. Lambdas also have a list of .signatures, each unique, one for each overload. Each signature is a type.

a = 42
b = :rip
c = -> (a) { a + a }
d = -> (a<System.Integer>, b<System.Integer> = 0) { a + b }
var Hapi = require('hapi');
var server = new Hapi.Server('localhost', 5000);
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
reply('hello world');
}
## config/initializers/conf_conf.rb
# load user-specific environment files
# (env* should be added to .gitignore)
[
Rails.root + "env_#{Rails.env}.rb",
Rails.root + 'env.rb'
].each do |env_file|
require env_file if env_file.file?
end
class FunctionalArray
attr_reader :head
attr_reader :tail
def initialize(*items)
@head = items.first
tail = items[1..-1]
@tail = (tail.count > 0) ? self.class.new(items[1..-1]) : []
end

Run $ ruby logo.rb in a directory with rip.txt.