Skip to content

Instantly share code, notes, and snippets.

Using the default profile...
Feature: Discovering
Scenario: Visitors are enticed into reading a book # features/discovering.feature:3
Given there is a book called "Redpoint" # features/step_definitions/discovering_steps.rb:1
And an administrator has entered details about the concept # features/step_definitions/discovering_steps.rb:5
When I visit the home page # features/step_definitions/discovering_steps.rb:10
Frame number: 0/49
= render partial:'countdown', locals: {book: @book}
- tile_order = !@book.tile_order.nil? ? @book.tile_order.split(',') : (0..@book.chapters_count).to_a
- binding.pry
.grid#b{:isotope => true}
.gutter-sizer
- tile_order.each do |i|
.item.col-2
.item-wrapper
= render partial:'img_tile', locals: {:index => (i.to_i) - 1}
- if @book.slug == 'redpoint'
Delivered-To: walidvb@gmail.com
Received: by 10.182.93.133 with SMTP id cu5csp123251obb;
Tue, 24 Jun 2014 04:10:33 -0700 (PDT)
X-Received: by 10.224.55.83 with SMTP id t19mr513479qag.42.1403608233720;
Tue, 24 Jun 2014 04:10:33 -0700 (PDT)
Return-Path: <walid+caf_=walidvb=gmail.com@pigeonholepublishing.com>
Received: from mail-qc0-f177.google.com (mail-qc0-f177.google.com [209.85.216.177])
by mx.google.com with ESMTPS id l65si26570923qge.91.2014.06.24.04.10.33
for <walidvb@gmail.com>
def search(hashtag)
@client = Twitter::REST::Client.new do |config|
config.consumer_key = ENV["TWITTER_CONSUMER_KEY"]
config.consumer_secret = ENV["TWITTER_CONSUMER_SECRET"]
config.access_token = ENV["TWITTER_ACCESS_TOKEN"]
config.access_token_secret = ENV["TWITTER_ACCESS_SECRET"]
end
@client.search(hashtag).attrs[:statuses]
end
@walidvb
walidvb / thedirective
Created June 15, 2014 13:04
A tumblr service to embed tumblr in a second
<my-tumblr></my-tumblr>
Scenario: Book is private
Given there is a published book
And the book is private
When I visit the book
Then I should be on the home page
if fetching /*, fetch /app/*
if ! request.referer is collinfontaine.ch
if ! (/drupal/user || /drupal/admin || drupal/node/*/edit)
rewrite /drupal to /app #to avoid people visiting the drupal site
if crawler
rewrite / to /drupal/home
class Chapter < ActiveRecord::Base
has_attached_file :file,
:storage => :filesystem
def to_file
if Rails.env != "test"
#open(file.url) { |f| @content = f.read}
@content = file.copy_to_local_file.read
@filename = file_file_name
else
Book
has_many chapters
accepts_nested_attributes_for :chapters, :allow_destroy => true
Chapter
belongs_to :book
has_one :storyboard
has_many :tiles, :through => :storyboard
accepts_nested_attributes_for :tiles, :allow_destroy => true
-----o-----master
\------o-------int
\--------------br1
To:
-----o-----master
\--------------int