Skip to content

Instantly share code, notes, and snippets.

View belguzmani's full-sized avatar

Bel Guzman belguzmani

View GitHub Profile
@belguzmani
belguzmani / conversation-messages.rb
Last active August 29, 2015 14:19
Ruby Object acts as Array
class Conversation
has_many :messages
def << m
self.messages << m
end
end
class Message
belongs_to :conversation
@belguzmani
belguzmani / user_referals.rb
Last active August 29, 2015 14:05
User Referals
class XUser
include Mongoid::Document
field :name
has_one :x_referal, :class_name => XReferal, :inverse_of => :referal_user
has_many :referal_urls, :class_name => XReferal, :inverse_of => :x_user
end
class XReferal
include Mongoid::Document
include Mongoid::Timestamps
### Basics (3 main branches + Releases)
1. Master Branch
- This is the cleanest code that is ready to deploy at any time.
- Commits are tagged with version numbers.
- It lives forever.
2. Development Branch
- No development will happen here, only merges from Feature branches and Release branches.
- It is never merged into any other branch.
- Nobody will commit to this branch. Depending on the project's structure and team culture, selected individuals will merge pull requests into the Development branch.
- It never dies.
@belguzmani
belguzmani / border.css
Last active December 26, 2015 06:49
Vertical border with gradient
.bot-left {
position: relative;
}
.bot-left:before, .bot-left:after {
content: "";
position: absolute;
bottom: 0px;
left: 0px;
}
.bot-left:before {