Skip to content

Instantly share code, notes, and snippets.

View futhr's full-sized avatar
:octocat:

Tobias Bohwalli futhr

:octocat:
View GitHub Profile
@futhr
futhr / TechDecisions.md
Last active October 4, 2015 12:58 — forked from hardbap/TechDecisions.md
Choices to make in a new Rails project.

Team Support

Source Code Control

Github
Alternative: Bitbucket, git (private server)

Time Tracking

None

# updated from the original @ http://cheat.errtheblog.com/s/rspec_shoulda
# just a subset -- models -- is included here. I'll update this, and create cheat sheets for others, as I go along.
# I marked the ones I added with NEW and also added the links to the corresponding code, as I think it's useful.
# Any comments/corrections are welcome!
# ================= Data and Associations =======================
# https://github.com/thoughtbot/shoulda-matchers/tree/master/lib/shoulda/matchers/active_record
it { is_expected.not_to have_db_column(:admin).of_type(:boolean) }
it { is_expected.to have_db_column(:salary).
@futhr
futhr / badges
Last active December 19, 2015 03:58
Replace strings elgalu with your github user and boolean_class with your github repo name. Memo copy from http://elgalu.github.io/2013/add-achievement-badges-to-your-gem-readme
# TODO: Your gem name
[![Gem Version][GV img]][Gem Version]
[![Build Status][BS img]][Build Status]
[![Dependency Status][DS img]][Dependency Status]
[![Code Climate][CC img]][Code Climate]
[![Coverage Status][CS img]][Coverage Status]
## Description
@futhr
futhr / spree.rb
Last active December 19, 2015 05:39
Sample of more or less full config for Spree 2.x @ config/initializers/spree.rb
Spree.config do |config|
# Amazon S3
config.use_s3 = true
config.s3_bucket = 'mybucket'
config.s3_access_key = ENV['S3_ACCESS_KEY_ID']
config.s3_secret = ENV['S3_SECRET_ACCESS_KEY']
config.attachment_url = ':s3_eu_url'
config.s3_host_alias = 's3-eu-west-1.amazonaws.com' # EU
# Mail
@futhr
futhr / locale_spec.rb
Last active December 20, 2015 00:19
Standard locale testing for consistency using i18n-spec gem.
RSpec.describe 'locale:' do
Dir.glob('config/locales/*.yml') do |locale_file|
context locale_file do
it { is_expected.to be_parseable }
it { is_expected.to have_valid_pluralization_keys }
it { is_expected.not_to have_missing_pluralization_keys }
it { is_expected.to have_one_top_level_namespace }
it { is_expected.not_to have_legacy_interpolations }
it { is_expected.to have_a_valid_locale }
it { is_expected.to be_a_complete_translation_of 'config/locales/en.yml' }
@futhr
futhr / navigation_helper.rb
Created July 29, 2013 19:42
Extend Spree::Admin::NavigationHelper with new link button.
module Spree
module Admin
module NavigationHelper
def link_to_translation(resource)
link_to_with_icon 'icon-flag no-text', '',
admin_translations_path(resource.to_s.pluralize, resource.id),
title: Spree.t(:translations)
end
end
end
@futhr
futhr / spree_cheats.rb
Created August 2, 2013 23:32
A quick way to create sample data testing Spree extensions.
# in your code
binding.pry
# pry console
require 'factory_girl'
require 'spree/testing_support/factories' # spree core factories
FactoryGirl.find_definitions # extension factories
# orders
FactoryGirl.create :order_with_totals
@futhr
futhr / capybara_cheat_sheet.rb
Last active December 20, 2015 14:29 — forked from ootoovak/capybara cheat sheet.rb
Collection of Capybara >= 2.1 stuff for feature specs.
# Navigating
visit '/projects'
visit post_comments_path(@post)
# Clicking links and buttons
click_link 'id_of_link'
click_link 'Link Text'
click_button 'Save'
@futhr
futhr / dabblet.css
Created September 9, 2013 19:23
Letterpress text Fx
/**
* Letterpress text Fx
* Issue: text shadow need to go on inside.
*/
@font-face {
font-family: 'LeagueGothicRegular';
src: url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/league_gothic-webfont.eot');
src: url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/league_gothic-webfont.eot?iefix') format('eot'),
url('http://www.midwinter-dg.com/blog_demos/css-text-shadows/fonts/league_gothic-webfont.woff') format('woff'),
@futhr
futhr / dabblet.css
Created September 9, 2013 19:23
Letterpress text Fx
/**
* Letterpress text Fx
* Issue: text shadow need to go on inside.
*/
@import url(http://fonts.googleapis.com/css?family=Monofett|Crushed|Voces|Quattrocento|Open+Sans|Play|Yanone+Kaffeesatz|Carrois+Gothic+SC|Zeyada|Covered+By+Your+Grace|Allura);
body {
text-align:center;
background: url(http://www.midwinter-dg.com/blog_demos/css-text-shadows/images/letterpress.gif) repeat;