Skip to content

Instantly share code, notes, and snippets.

View veezus's full-sized avatar

Veez Remsik veezus

View GitHub Profile
# frozen_string_literal: true
ruby '2.5.1'
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "rspec"
# application.rb
class ApplicationDSL
attr_accessor :applications
def initialize
self.applications = []
end
def application(name, &block)
application = Application.new(name)
ActiveRecord::Schema.define(:version => 20120620132905) do
create_table "tasks", :force => true do |t|
t.string "name"
t.integer "sender_id"
t.integer "receiver_id"
end
create_table "users", :force => true do |t|
t.string "name"
end
@veezus
veezus / gist:1262697
Created October 4, 2011 20:27
Boolean negation
def is_it_true?
# calculate the result
not result
end
def is_it_true?
# calculate the result
!result
end
def update_main_artist
artist = artists.first
if rovi_artist
artist = Artist.create(:name => rovi_artist.name)
end
update_attribute :main_artist_id, artist.id
end
def update_main_artist
class Foo
def public_function
# do stuff
end
def private_function
# do stuff
end
private :private_function
set wildmenu " allow tab to cycle through found options
set wildmode=list:longest
hcd dotmatrix
git fetch
git co -t origin/testify
./bin/hlink
. ~/.hashrc
hcd <project>
SAYIT=loud testify # => and then save a test!
# ~/.bashrc.local
alias watch="watchr ~/.watchr.rb"
# ~/.watchr.rb
if File.exists?(".rspec")
@spec = 'rspec'
else
@spec = 'spec'
end
describe "something else" do
let(:dealer) { Fabricate(:dealer) }
it { p dealer.id } #=> 38
it { p dealer.id } #=> 39
end