Links and Notes from my Classy Git RubyConf talk:
| " | |
| " While editing a Markdown document in Vim, preview it in the | |
| " default browser. | |
| " | |
| " Author: Nate Silva | |
| " | |
| " To install: Place markdown.vim in ~/.vim/ftplugin or | |
| " %USERPROFILE%\vimfiles\ftplugin. | |
| " | |
| " To use: While editing a Markdown file, press ',p' (comma p) |
| # These are my notes from the PragProg book on CoffeeScript of things that either | |
| # aren't in the main CS language reference or I didn't pick them up there. I wrote | |
| # them down before I forgot, and put it here for others but mainly as a reference for | |
| # myself. | |
| # assign arguments in constructor to properties of the same name: | |
| class Thingie | |
| constructor: (@name, @url) -> | |
| # is the same as: |
| # for more info: https://gist.github.com/1120938 |
If you use VMWare Fusion on OSX and would like to control it on the command line then fission by @thbishop is worth trying out!
Fission is new and only only has a few features but looks very promising to me, I will be keeping an eye on it for one.
| # add this to your spec helper | |
| RSpec.configure do |config| | |
| config.treat_symbols_as_metadata_keys_with_true_values = true | |
| config.filter_run :focus => true | |
| config.run_all_when_everything_filtered = true | |
| end | |
| # and then use the :focus tag in your specs | |
| it "does something awesome", :focus do |
| #!/usr/bin/env ruby | |
| require "redis" | |
| redis = Redis.new | |
| redis.keys("*").each do |key| | |
| val = case redis.type(key) | |
| when "string" | |
| redis.get key | |
| when "list" |
Fibur is a library that allows concurrency during Ruby I/O operations without needing to make use of callback systems. Traditionally in Ruby, to achieve concurrency during blocking I/O operations, programmers would make use of Fibers and callbacks. Fibur eliminates the need for wrapping your I/O calls with Fibers and a callback. It allows you to write your blocking I/O calls the way you normally would, and still have concurrent execution during those I/O calls.
Say you have a method that fetches data from a network resource:
| #!/usr/local/bin/macruby | |
| framework 'Cocoa' | |
| framework 'QuartzCore' | |
| framework 'CoreGraphics' # Mountain Lion Update | |
| class FireworkDelegate | |
| attr_accessor :window | |
| def initWithURL(url) | |
| case url |
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.