Skip to content

Instantly share code, notes, and snippets.

View belguzmani's full-sized avatar

Bel Guzman belguzmani

View GitHub Profile
@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 {
### 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 / 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
@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
class Person
include Mongoid::Document
field :email, type: String
field :month, type: Date
field :monthly_total, type: Hash, default: {:email_open => 0, :email_click => 0, :page_view => 0}
has_many :monthly_events
end
class MonthlyEvent
RSpec.describe InvestmentType, type: :model do
subject { create :investment_type }
it { is_expected.to have_attributes(name: 'Real Estate') }
end
RSpec.describe ComplianceItems, type: :model do
context 'no parents' do
subject { create :compliance_item }
@belguzmani
belguzmani / forms.rb
Last active March 14, 2017 00:17
Forms modeling
Rspec.describe Form, type: :model do
it { is_expected.to belong_to(:user) }
it { is_expected.to have_field(:title) }
it { is_expected.to have_field(:require_signature) }
it { is_expected.to have_many(:form_shares) }
end
RSpec.describe FormShare, type: :model do
it { is_expected.to belong_to(:form) }
@belguzmani
belguzmani / communities
Created October 16, 2018 03:22
List of classrooms.
[
[ 0] [
[0] "Westwood Elementary School",
[1] "Kindergarten 1 - 2018-2019",
[2] "1568f433"
],
[ 1] [
[0] "Westwood Elementary School",
[1] "Kinder Garden 2 - 2018-2019",
[2] "06c82c3a"
[
[ 0] [
[0] "Westwood Elementary School",
[1] "John Ruiz",
[2] "f94b6596"
],
[ 1] [
[0] "Westwood Elementary School",
[1] "Adrian Petrucci",
[2] "2b8d5d80"