This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold | |
old = red bold |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ items.to_query | |
- | |
- def query(items) | |
- @query = '' | |
- items.each do |var| | |
- @query << "#{var.to_s}=" + eval("@#{var}") + "&" if eval("@#{var}") | |
- end | |
- URI.escape(@query) | |
- end | |
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
encodeURIComponent(q).replace(/%20/g, '+').replace(/%2C/g, ',').replace(/%26/g, '&').replace(/%3D/g, '=').replace(/%2B/g, '+') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def email_must_be_uniq | |
user = User.find_by_email(email) | |
if user.present? && user.id =! self.id | |
errors.add(:email, "is already taken") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
has_many :enrollments, class_name: "CourseEnrollment", conditions: "course_enrollments.role='student'", dependent: :destroy | |
has_many :student_enrollments, class_name: "CourseEnrollment", conditions: "course_enrollments.role='student'", dependent: :destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def admin | |
if read_attribute(:admin) == "t" || read_attribute(:admin) == "1" | |
true | |
else | |
false | |
end | |
end | |
def admin=(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TODO Still don' know what this controller is for and what to do wiith it... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActsAsTaggableOn::Tag.includes(:taggings).where("taggings.taggable_type = 'Question'").select("DISTINCS tags.*") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} } | |
] |
OlderNewer