This file contains hidden or 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
source 'https://rubygems.org' | |
gem 'mechanize' |
This file contains hidden or 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
// Source: https://github.com/muut/riotjs/issues/727 | |
var Model = function (attrs) { | |
// init | |
this.attributes = attrs || {} | |
riot.observable(this) | |
// set method | |
this.set = function (key, val, options) { |
This file contains hidden or 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
<comment-box> | |
<h1>{ opts.title }</h1> | |
<comment-list url={ opts.url } comments={ comments } /> | |
<comment-form url={ opts.url } /> | |
this.comments = [] | |
add(comment) { | |
this.comments.push(comment) |
This file contains hidden or 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
App = Ember.Application.create() | |
App.Router.map -> | |
# put your routes here | |
App.IndexRoute = Ember.Route.extend(model: -> | |
parsedInput: 'ol' | |
) |
This file contains hidden or 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
# spec_helper.rb | |
require 'rspec' | |
require 'watir-webdriver' | |
require 'page-object' | |
require 'page-object/page_factory' | |
require 'require_all' | |
require_all 'lib/pages' | |
RSpec.configure do |config| |
This file contains hidden or 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
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with the same name as the keys in <tt>filtering_params</tt> | |
# with their associated values. Most useful for calling named scopes from |
This file contains hidden or 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
module CapybaraWithPhantomJs | |
include Capybara | |
# Create a new PhantomJS session in Capybara | |
def new_session | |
# Register PhantomJS (aka poltergeist) as the driver to use | |
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new(app) | |
end |
This file contains hidden or 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
module Erector::Rails | |
class FormBuilder | |
def method_missing(method_name, *args, &block) | |
if parent.respond_to?(method_name) | |
return_value = parent.send(method_name, *args, &block) | |
case return_value | |
when ActiveSupport::SafeBuffer | |
template.concat(return_value) |
This file contains hidden or 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
.fc { | |
direction: ltr; | |
text-align: left; } | |
.fc table { | |
border-collapse: collapse; | |
border-spacing: 0; } | |
.fc .btn { | |
line-height: 1.2em; } | |
html .fc { |
This file contains hidden or 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: nginx init.d script for Ubuntu 8.10 and lesser versions. | |
# Description: nginx init.d script for Ubuntu 8.10 and lesser versions. | |
### END INIT INFO |