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
def sample_file(extension) | |
path = Rails.root.join('spec', 'files', "sample.#{extension}") | |
type = Mime::Type.lookup_by_extension(extension) | |
Rack::Test::UploadedFile.new(path, type) | |
end |
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 "minitest_helper" | |
describe User do | |
it "rejects a bad password in validation" do | |
user = Factory.build(:user, :password_confirmation => 'Not my password') | |
user.invalid?(:password_confirmation).must_equal true | |
user.errors[:password_confirmation].must_equal "Password doesn't match confirmation" | |
end | |
end |
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
//scroll to top | |
function scrollToTop(){ | |
$('.goTop').hide(); | |
$(window).scroll(function () { | |
if ($(this).scrollTop() > 100) { | |
$('.goTop').fadeIn(); | |
} else { | |
$('.goTop').fadeOut(); | |
} | |
}); |
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
group :production do | |
# Many instances of an app on a single Dyno | |
gem 'puma' | |
end |
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 ruby | |
# encoding: utf-8 | |
# x264 presets guide : https://forum.handbrake.fr/viewtopic.php?f=6&t=19426 | |
X264 = "b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all" | |
FORMAT = "--optimize --format mp4" | |
QUALITY = "--ab 64 --mixdown mono --quality 23 -e x264 -x '#{X264}'" | |
SIZE = "--width 1280 --height 720" | |
ARGV.each do |param| |
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
[alias] | |
a = add | |
b = branch | |
c = commit | |
co = checkout | |
cob = checkout -b | |
d = diff --word-diff | |
l = log --oneline --decorate | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %Cblue(%an)%Creset' --abbrev-commit --date=relative | |
phcs = push hcsgit |
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
$baseFontSize: 12px | |
$baseLineHeight: 18px | |
$headingsFontWeight: normal | |
$headingsColor: #1A3E8E | |
$linkColor: #2f5bb9 | |
$btnInverseBackground: #666 | |
// Core variables and mixins | |
// Modify this for custom colors, font-sizes, etc | |
@import "bootstrap/variables" |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Railscasts</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
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 | |
# Get to the Rails app's root directory | |
cd `dirname $0`/.. | |
APP_DIRECTORY=`pwd` | |
APP_NAME=`basename $APP_DIRECTORY` | |
# How-to: | |
# http://www.ryandaigle.com/a/pgtransfer-is-the-new-taps |
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
source 'http://rubygems.org' | |
ruby '1.9.3' | |
gem 'rails', '3.2.12' | |
gem 'pg' # PostgreSQL | |
gem 'dalli' # Modern & fast pure-ruby memcached client | |
gem 'rack-cache' # HTTP caching (only one available for heroku) | |
gem 'slim' # Faster-than-HAML templating engine | |
gem 'kaminari' # Rails 3 scopes based pagination | |
gem 'stringex' # Convert string to ascii, to url |