Skip to content

Instantly share code, notes, and snippets.

View ahmdrefat's full-sized avatar
🏗️
I may be slow to respond.

Ahmed R. Hussein ahmdrefat

🏗️
I may be slow to respond.
View GitHub Profile
@ahmdrefat
ahmdrefat / lecture.rb
Created April 23, 2012 14:13
lecture model
class Lecture < ActiveRecord::Base
# to be able to like courses
include Diaspora::Likeable
# to be able to like courses
include Diaspora::Commentable
# asscoiation with other new modules
belongs_to :courses
@ahmdrefat
ahmdrefat / enrollment.rb
Created April 23, 2012 14:14
enrollment model
class Enrollment < ActiveRecord::Base
# associate lectures with courses
belongs_to :course
# associate lectures with people
belongs_to :person
end
@ahmdrefat
ahmdrefat / person.rb
Created April 23, 2012 14:17
person model
# associate people with courses through enrollment
has_many :enrollments
has_many :courses, :through => :enrollments
@ahmdrefat
ahmdrefat / controllers.sh
Created April 23, 2012 14:19
Generating new controllers
# run first
rails g controller Courses
# and then
rails g controller Lectures
@ahmdrefat
ahmdrefat / index.haml
Created April 23, 2012 14:21
initial views
%h1 List of Courses
/ And in the second file
%h1 List of Lectures
@ahmdrefat
ahmdrefat / routes.rb
Created April 23, 2012 14:22
add new routes
# Add routes
resources :courses
resources :lectures
@ahmdrefat
ahmdrefat / rails_s.sh
Created April 23, 2012 14:23
run rails server
rails server
@ahmdrefat
ahmdrefat / Custom.css
Created April 28, 2012 14:18 — forked from bentruyman/Custom.css
IR_Black Theme for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@ahmdrefat
ahmdrefat / chrome.css
Created April 28, 2012 14:19
Darker Skin by Darcy Clarke - 2011
/**********************************************/
/*
/* Darker Skin by Darcy Clarke - 2011
/*
/* For how to install, or more themes, check out:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
/* Color scheme is based on Joe Bergantine's Specials Board:
/* http://joebergantine.com/werkstatt/seestyle
/*
@ahmdrefat
ahmdrefat / gist:2519458
Created April 28, 2012 14:28 — forked from dougwaldron/gist:1151942
More Chrome Inspector CSS
/* Additional styles for Chrome Inspector; should be used with
http://darcyclarke.me/design/skin-your-chrome-inspector/
and
http://dpaste.com/hold/595890/
*/
#elements-content li.hovered:not(.selected) .selection {
/* hover color */
background: rgba(255, 255, 255, .2) !important;
}
#elements-content .selection.selected {