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
# Orig | |
def items options = Hash.new | |
products = true_category.descendant_products.available.visible | |
if options[:vendor] | |
products = products.by_vendor options[:vendor] | |
end | |
if options[:factor] |
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
<html> | |
<head> | |
<title>Checkbox Complete Demo</title> | |
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script> | |
</head> | |
<body> | |
<form action="#" class="no-submit"> | |
<h1>Show/hide submit based on whether a checkbox is checked or not</h1> | |
<p> | |
<h2>The scenario</h2> |
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
class Example.Views.Table extends Backbone.View | |
template: JST['example/table'] | |
initialize: -> | |
_.bindAll @, 'addOne', 'addAll' | |
@collection.on 'add', @addOne | |
render: -> | |
@$el.html @template() |
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
%a.toggle-advanced{ href: '#' } | |
%span + | |
%strong Click here for advanced options |
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
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
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
require 'rspec' | |
require_relative '../app/models/model_name' | |
describe ModelName do | |
it "passes a sanity test" do | |
model = ModelName.new | |
model.new_record?.should be_true | |
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
require 'rspec' as "Spec" | |
require 'nokogiri' as "Nok" | |
require 'open_uri' as "Open" | |
class Index | |
attr_reader :response | |
def initialize url | |
@response = Nok::HTML Open url |
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
describe "Test feature" do | |
context "an external API request continuity" do | |
use_vcr_cassette | |
it "tests one behavior related to a url" | |
it "tests another behavior related to the the same url" | |
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
# Actual filename: .rspec | |
--format doc | |
--color |
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
fb :: [Integer] -> [String] | |
fb list = [ fizzbuzz element | element <- list ] | |
where fizzbuzz x = fizz x ++ buzz x | |
where fizz x = if x `mod` 3 == 0 then "Fizz" else "" | |
buzz x = if x `mod` 5 == 0 then "Buzz" else "" |
OlderNewer