Skip to content

Instantly share code, notes, and snippets.

@miketierney
miketierney / SassMeister-input.sass
Created August 11, 2014 01:47
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.7)
// ----
=e($name)
@at-root #{&}__#{$name}
@content
=m($name)
@at-root #{&}--#{$name}
if options[:fast]
options[:ignorecase] ? pattern = Regexp.new(Regexp.escape(ARGV.shift), 1) : pattern = Regexp.new(Regexp.escape(ARGV.shift))
elsif options[:ignorecase]
pattern = Regexp.new(ARGV.shift, 1)
else
pattern = Regexp.new(ARGV.shift)
end
# Inserting the regular expression in to the conditional statement. line is the lambda |line|, as part of
# an iteration.
if line =~ /#{pattern}/
#!/usr/bin/env ruby -w
require 'optparse'
require 'open-uri'
class PowerGrep
def initialize
@results => "Initialized!"
end
lastfm_call = Nokogiri::XML(open("http://ws.audioscrobbler.com/2.0/?method=track.getsimilar&artist=#{artist}&track=#{track}&api_key=#{@api_key}"))
require 'test_helper'
class CartTest < ActiveSupport::TestCase
test "initialize" do
cart = Cart.new
assert_equal 0, cart.items.length
end
test "add product" do
test "should create user" do
assert_difference('User.count') do
post :create, :user => {
:name => "Bob Smith",
:password => "test",
:password_confirmation => "test"
}
end
assert_redirected_to :action => 'index'
#!/bin/sh
#
# Will append the current Lighthouse ticket number to the commit message automatically
# when you use the 1234-foo-bar branch naming convention.
#
# Drop into .git/hooks/commit-msg
# chmod +x .git/hooks/commit-msg
exec < /dev/tty
@miketierney
miketierney / gist:69768
Created February 24, 2009 20:36 — forked from loe/gist:69444
class Group < ActiveRecord::Base
belongs_to :location
validates_presence_of :name, :location_id
def self.sort(page, order)
options = {}
if order == 'location'
options[:order] = 'location_id'
#!/bin/sh
#
# Will append the current Lighthouse ticket number to the commit message automatically
# when you use the 1234-foo-bar branch naming convention.
#
# Drop into .git/hooks/commit-msg
# chmod +x .git/hooks/commit-msg
exec < /dev/tty