Skip to content

Instantly share code, notes, and snippets.

Michael Bulat mbulat

Block or report user

Report or block mbulat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install_scala_sbt.sh
#!/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
@mbulat
mbulat / generators_from_models.rb
Last active Dec 26, 2015
Ruby script to generate generator commands from existing models
View generators_from_models.rb
# 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 }
@mbulat
mbulat / gist:892544
Created Mar 29, 2011
Earthquake plugin to open a link in a tweet
View gist:892544
# 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 / gist:231022
Created Nov 10, 2009 — forked from clayton/gist:89659
RCov task which can report aggregated or seperate rspec and cucumber coverage
View gist:231022
# 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'
You can’t perform that action at this time.