visit('/projects')
visit(post_comments_path(post))
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
server { | |
listen 80; | |
server_name example.com; | |
rewrite ^/(.*) https://$server_name permanent; | |
} | |
server { | |
# Your application host will be used as a convention for directories and other stuffs | |
set $application_host "example.com"; | |
# Rails application server timeout (we have to match the value here to not display Gateway Timeout error) |
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
module ApplicationHelper | |
def tenant_name | |
tenant_configuration.tenant_name | |
end | |
def full_title(page_title) | |
base_title = "#{app_display_name} Dashboard" | |
if page_title.empty? | |
base_title | |
else |
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_relative "hget" | |
# client = FBPublic.new("penaltybr") | |
# client.data # returns the Graph API public data | |
# if you need see response details use: | |
# client.response # returns a Net::HTTPFound instance | |
# if you need an alias to get the api response use: | |
# fb_data = FBPublic.get_data("penaltybr") # returns the Graph API public data |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
# spec/support/database_cleaner.rb | |
require 'database_cleaner' | |
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner.clean_with :truncation # Delete leftovers if any | |
DatabaseCleaner.strategy = :transaction | |
end | |
config.before(:each) do |
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
// REQUIRES: | |
// http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js | |
// http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js | |
// Based on: https://gist.github.com/1395926 | |
$(document).ready(function() { | |
$('.gist').each(function(i) { | |
var file_separator = $(this).text().indexOf('#'); | |
if (file_separator != -1) { | |
var gist_url = $(this).text().slice(0, file_separator); | |
var gist_file = $(this).text().slice(file_separator).replace("#file_", "?file="); |
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
#! /bin/bash | |
gem list | cut -d" " -f1 | xargs gem uninstall -aIx |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
app_name = ARGV[0] | |
initial_resource_name = ask('What is your initial resource ?') | |
remove_file 'Gemfile' | |
create_file 'Gemfile', <<-eos | |
source 'https://rubygems.org' | |
gem 'rails', '3.2.6' |
NewerOlder