Skip to content

Instantly share code, notes, and snippets.

View tuomasj's full-sized avatar

Tuomas Jomppanen tuomasj

View GitHub Profile
@tuomasj
tuomasj / Gemfile
Created August 24, 2012 09:10
Live Reload
source "https://rubygems.org"
gem 'guard'
gem 'guard-livereload'
gem 'rack-livereload'

This is how we test that all translation keys match up between locales.

Stuff that only goes in one locale (such as an admin section) or that can't be translated yet (if you use external translators) can simply go in files that don't match the path "config/locales/??.yml", like "config/locales/wip.fo.yml".

@tuomasj
tuomasj / have_link_endswith.rb
Last active December 27, 2015 11:29
Have a link that ends with specific text, Capybara matcher
@tuomasj
tuomasj / activation_email_spec.rb
Created November 21, 2013 15:49
Testing Activation Emails with Capybara, RSpec and Custom Matcher. I wrote blog post which is here: http://tuom.as/2013/11/20/testing-activation-emails-with-capybara-rspec-and-custom-matcher.html
require 'spec_helper'
describe "Activation Email" do
it "confirms the email when user clicks the confirmation link on activation email" do
register_new_user("john.smith@example.com", "adobe password", "adobe password")
activation_token = User.last.activation_code
expect( open_last_email.body).to have_link_with_endswith(activation_token)
visit activation_path(activation_token)
expect(page).to have_content( "Your email has been confirmed.")
end
@tuomasj
tuomasj / .rspec
Created February 15, 2014 20:59 — forked from coreyhaines/.rspec
--colour
-I app
function _git_prompt() {
local git_status="`git status -unormal 2>&1`"
if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
if [[ "$git_status" =~ nothing\ to\ commit ]]; then
local ansi=42
elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
local ansi=43
else
local ansi=45
fi
@tuomasj
tuomasj / Preferences.sublime-settings
Last active January 28, 2017 11:32
My Sublime Text 3 settings file
// Preferences.sublime-settings
// Sublime Text 3, 28.1.2017
{
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"auto_complete_with_fields": true,
"bold_folder_labels": true,
"default_encoding": "UTF-8",
"detect_indentation": true,
@tuomasj
tuomasj / patch-edid.rb
Created September 14, 2017 08:34
Create display override file to force Mac OS X to use RGB mode for Display
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
#
# Update 2013-06-24: added -w0 option to prevent truncated lines
#
# original source: https://embdev.net/topic/284710#3027030 (by Andreas Schwarz)
require 'base64'
@tuomasj
tuomasj / .bash_aliases
Created October 22, 2017 08:30
Bash shell aliases
# Assuming that ~/.bash_aliases has the aliases defined
# These work on Bash, not sure what happens with other shells
# Run previous command
alias r='fc -s'
# Open .vimrc
alias vimrc="vim ~/.vimrc"
# Reload aliases