Skip to content

Instantly share code, notes, and snippets.

Avatar

Jason Yi JasonY1

View GitHub Profile
View rake db:migrate:status
up 20150117091501 Devise create admin users
up 20150117091505 Create active admin comments
up 20150120010407 ********** NO FILE **********
up 20150127002712 ********** NO FILE **********
up 20150127225430 Create products
up 20150127230158 Create categories
View gist:cf4dde3c71f98353dca1
["image/jpg", "image/jpeg", "image/png", "image/gif"]
/^image\/(jpeg|png|gif|tiff|jpg)$/
View gist:f9b900f52542d662d9be
def reset_password!(new_password, new_password_confirmation)
self.password = new_password
self.password_confirmation = new_password_confirmation
if valid?
clear_reset_password_token
after_password_reset
end
save
View gist:21852890c820cb04fa5a
context "during the weekend" do
before do
before_open = Time.parse("01/04/2014 11:00 PST") # Saturday 11:00AM
while_open = Time.parse("01/04/2014 14:00 PST") # Saturday 2:00PM
after_closed = Time.parse("01/04/2014 18:00 PST") # Saturday 6:00PM
end
it "displays 'Phones Closed' before open" do
Time.stub(:now).returns(before_open)
expect { phone_lines_open?(before_open).to eq false }
end
View gist:b9518ccf14b5d158d026
class Event < ActiveRecord::Base
validates :title, :start_date, presence: true
validate :startdate_before_enddate
def startdate_before_enddate
if :end_date.present?
unless :start_date < :end_date
errors.add(:start_date, "must be before end date")
end
end
View gist:1873a845d1697e20d9ae
case
when p1[1] == "R" && p2[1] == "S" || p1[1] == "P" && p2[1] == "R" || p1[1] == "S" && p2[1] == "P" || p1[1] == p2[1]
then p1
else p2
end
View gist:94f5242e57324e349efb
Software Engineer
Software Engineering - MyCase | San Diego, CA, United States
We have small, high caliber teams developing easy-to-use solutions for our customers, and are looking for sharp Software Engineers to continue our rapid growth pace. If you enjoy building from back-end to client–side in an environment that values shared responsibility and continuous learning, apply today.
Responsibilities:
● Develop scalable, robust, and simple web-based solutions to solve complex business problems
● Formulate, implement, and evaluate algorithms and database queries to support SaaS scalability and stability.
View gist:9e88650bbab3f5162765
<p>
<strong>Commenter:</strong>
<%= comment.commenter %>
</p>
<p>
<strong>Comment:</strong>
<%= comment.body %>
</p>
View application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Gastro</title>
<%= stylesheet_link_tag "application", media: "all",
"data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
View application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Gastro</title>
<%= stylesheet_link_tag "application", media: "all",
"data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
You can’t perform that action at this time.