Skip to content

Instantly share code, notes, and snippets.

View veezus's full-sized avatar

Veez Remsik veezus

View GitHub Profile
class Foo
def public_function
# do stuff
end
def private_function
# do stuff
end
private :private_function
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
@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
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
# application.rb
class ApplicationDSL
attr_accessor :applications
def initialize
self.applications = []
end
def application(name, &block)
application = Application.new(name)
# frozen_string_literal: true
ruby '2.5.1'
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "rspec"