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
// FizzBuzz with Typescript Types | |
// from https://gal.hagever.com/posts/typing-the-technical-interview-in-typescript/ | |
// B is a subset, or equal to A | |
type Eq<A, B extends A> = 'passes'; | |
// test it out | |
type test_eq = [ | |
Eq<'Hello', 'Hello'>, | |
// Eq<'Hello', 'world'> // <- type error |
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
I upgraded ruby by typing "rvm upgrade ruby-1.9.2-p180 ruby-1.9.2-p290". I set default to the new one with "rvm --default use ruby-1.9.2-p290" | |
Except now when I open a new console, my rvm looks like this: | |
rvm info | |
ruby-1.9.2-p180: | |
system: | |
uname: "Linux fedora 2.6.38.7-30.fc15.i686.PAE #1 SMP Fri May 27 05:44:56 UTC 2011 i686 i686 i386 GNU/Linux" |
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
begin | |
raise | |
rescue => e | |
puts e.backtrace[0..4].join("\n") | |
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
(defun rspec-to-shoulda () | |
"Translates RSpec code to Shoulda | |
NOTE: You still have to wrap the results in a Test::Unit class" | |
(interactive) | |
(dolist (pair '(("\\(require\s.*/\\)\\([a-z_]+\\)'$" "\\1test_helper'") ;; require | |
("describe\s" "context ") ;; RSpec -> Shoulda syntax | |
("it\s" "should ") | |
("\s\"should\s" " \"") | |
("before\s" "setup ") | |
("before(:each)\s" "setup ") |
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
Eli sucks... srsly. |