Skip to content

Instantly share code, notes, and snippets.

@mbulat
mbulat / gist:231022
Created November 10, 2009 16:43 — forked from clayton/gist:89659
RCov task which can report aggregated or seperate rspec and cucumber coverage
# From http://github.com/jaymcgavren
#
# Save this as rcov.rake in lib/tasks and use rcov:all =>
# to get accurate spec/feature coverage data
#
# Use rcov:rspec or rcov:cucumber
# to get non-aggregated coverage reports for rspec or cucumber separately
require 'cucumber/rake/task'
require 'spec/rake/spectask'
@mbulat
mbulat / gist:892544
Created March 29, 2011 15:21
Earthquake plugin to open a link in a tweet
# Pass in a tweet id to open a link in the text
#
# :open $xx
Earthquake.init do
command %r|^:open\s+([^\/\s]+)$|, :as => :open do |m|
twitter.status(m[1]).tap do |s|
if s["text"]
link_match = s["text"].match(/(https?:\/\/\S*)/)
if link_match
Launchy.open(link_match[0])
@mbulat
mbulat / generators_from_models.rb
Last active December 26, 2015 21:28
Ruby script to generate generator commands from existing models
# RUN THIS FROM WITHIN THE RAILS CONSOLE OF THE APP
# WITH THE MODELS YOU'RE USING AS A TEMPLATE
RAILS_COMMAND = "rails g resource"
RAILS_COMMAND_OPTIONS = "--skip-migration"
FILE_NAME = "resource_generation.rb"
# First, ensure we've loaded all of the model classes
Dir.glob("#{Rails.root}/app/models/*.rb").sort.each { |file| require_dependency file }
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
sudo apt-get --yes install openjdk-6-jdk
wget http://www.scala-lang.org/files/archive/scala-2.11.2.deb
sudo dpkg -i scala-2.11.2.deb