Skip to content

Instantly share code, notes, and snippets.

jQuery ->
# Model
class window.LineItem extends Backbone.Model
url: -> if @id then "/line_items/#{@id}?" else "/line_items?appointment_id=#{parseInt(($ 'input#appointment_id').val())}"
clear: ->
@destroy()
@view.remove()
# Collection
jQuery ->
($ ".dots-switcher").each (index, list) -> new DotsSwitcher(list)
class DotsSwitcher
constructor: (container) ->
@container = ($ container);
@items = @container.find("li")
@count = @items.length
@makeDots()
@adammiribyan
adammiribyan / users_controller_spec.rb
Created October 8, 2012 01:05
Controller spec refactoring
context "#start_phone_call", :focus do
before :each do
@harry = FactoryGirl.create(:client, first_name: "Harry", stripe_customer_token: nil)
@arnold = FactoryGirl.create(:lawyer, first_name: "Arnold")
controller.stubs(:current_user).returns(@harry)
end
it "should redirect to payment info page unless client has already has it saved" do
get :start_phone_call, { id: @arnold.to_param, client_number: "6087004680" }
request.should redirect_to call_payment_path(@arnold.to_param)
@adammiribyan
adammiribyan / callback.erb
Created November 5, 2012 08:38 — forked from amfeng/callback.erb
Stripe OAuth Example -- Ruby
<!doctype html>
<head>
<title>Stripe OAuth Example</title>
</head>
<body>
<%= @access_token %>
</body>
</html>
@adammiribyan
adammiribyan / hiw_section.html.haml
Created April 13, 2013 00:41
Lawdingo HIW section description.
= render layout: 'section', locals: { image: 'image_path.png', position: :right | :left }
%h2 Title of the section
%p text
Images are supposed to be stored in app/assets/images/help/{clients | lawyers}/.
The :position option for the section is :left by default.
// The responsive.less is being loaded either way with "twitter/bootstrap/boostrap".
// So the solution is to import each component separately ignoring the ones we don't require.
@import "twitter/bootstrap/reset.less";
@import "twitter/bootstrap/variables.less";
@import "twitter/bootstrap/mixins.less";
@import "twitter/bootstrap/scaffolding.less";
@import "twitter/bootstrap/grid.less";
@import "twitter/bootstrap/layouts.less";
@import "twitter/bootstrap/type.less";
@import "variables.less";
@import "mixins.less";
@import "responsive-utilities.less";
@import "responsive-1200px-min.less";
[Story](https://www.pivotaltracker.com/...)
<description of work>
### Dependencies
- [ ] <other PR and tasks>
### Reviews
- [ ] @<users you think should review this PR>
create_table :students do |t|
t.string :first_name
t.string :last_name
t.string :citizenship
t.string :rodne_cislo
t.string :group
t.date :date_of_birth
t.string :studies_state
t.string :primary_specialty
t.string :secondary_specialty