Skip to content

Instantly share code, notes, and snippets.

View jsteiner's full-sized avatar

Josh Steiner jsteiner

View GitHub Profile
module ScrollableTabView
exposing
( view
, initialPage
, tabBarActiveTextColor
, tabBarInactiveTextColor
, tabBarUnderlineStyle
, tabBarTextStyle
, tabBarStyle
)
@jsteiner
jsteiner / context.md
Last active October 28, 2016 19:15
On context

Thanks for reading Testing Rails! Here's some quick answers to some of your questions. I'll clean this up later and add a section in the book.

context

I primarily use context for communication around conditionals. Or in other words, to give extra context around what the it will be testing. Since I don't use let or before blocks, I don't use context blocks to group common setup functionality. So, they don't provide any additional

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

@jsteiner
jsteiner / database_cleaner.rb
Created January 10, 2014 20:31
Database Cleaner
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
@jsteiner
jsteiner / app.css
Last active December 30, 2015 09:49
.wufoo {
background-color: red !important;
}
form.wufoo .info h2 {
color: red !important;
}
let g:rails_projections = {
\ "config/projections.json": {
\ "command": "projections"
\ },
\ "spec/features/*_spec.rb": {
\ "command": "feature",
\ "template": "require 'spec_helper'\n\nfeature '%h' do\n\nend",
\ },
\ "spec/support/*.rb": {
\ "command": "support"
" Edit another file in the same directory as the current file
map <Leader>e :e <C-R>=expand("%:p:h") . '/'<CR>
map <Leader>s :split <C-R>=expand("%:p:h") . '/'<CR>
map <Leader>v :vsplit <C-R>=expand("%:p:h") . '/'<CR>
map <Leader>te :tabe <C-R>=expand("%:p:h") . '/'<CR>
@jsteiner
jsteiner / rails.vim
Created October 11, 2013 14:19
Current Rails.vim projections
let g:rails_projections = {
\ "config/projections.json": {
\ "command": "projections"
\ },
\ "spec/features/*_spec.rb": {
\ "command": "feature",
\ "template": "require 'spec_helper'\n\nfeature '%h' do\n\nend",
\ },
\ "spec/support/*.rb": {
\ "command": "support"
@jsteiner
jsteiner / flashcards.rb
Last active December 19, 2015 18:48
Flashcards
module Flashcards
class Card
attr_accessor :front, :back
def initialize(front, back)
@front = front
@back = back
end
def play
@jsteiner
jsteiner / .vimrc
Last active August 29, 2016 03:15
Example .vimrc projections, including projections for Active Model Serializers, Draper, and FactoryGirl
let g:rails_projections = {
\ "config/projections.json": {
\ "command": "projections"
\ },
\ "spec/features/*_spec.rb": {
\ "command": "feature",
\ "template": "require 'spec_helper'\n\nfeature '%h' do\n\nend",
\ }}
let g:rails_gem_projections = {