This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| $('#my_form').submit (event) -> | |
| event.preventDefault() | |
| $.ajax | |
| url: $(@).attr("action") | |
| data: new FormData(@) | |
| type: "POST" | |
| cache: false | |
| contentType: false | |
| processData: false |
This file contains hidden or 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
| # A sample Guardfile | |
| # More info at https://github.com/guard/guard#readme | |
| guard 'livereload' do | |
| watch(%r{app/.+\.(erb|haml)}) | |
| watch(%r{app/helpers/.+\.rb}) | |
| watch(%r{(public/|app/assets).+\.(css|js|html)}) | |
| watch(%r{(app/assets/.+\.css)\.s[ac]ss}) { |m| m[1] } | |
| watch(%r{(app/assets/.+\.js)\.coffee}) { |m| m[1] } | |
| watch(%r{config/locales/.+\.yml}) |
This file contains hidden or 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
| ENV["RAILS_ENV"] = "test" | |
| require 'rubygems' | |
| require 'spork' | |
| #uncomment the following line to use spork with the debugger | |
| #require 'spork/ext/ruby-debug' | |
| Spork.prefork do | |
| require File.expand_path('../../config/environment', __FILE__) | |
| require 'rails/test_help' |
This file contains hidden or 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
| .ribbon | |
| overflow: hidden | |
| // top left corner | |
| position: absolute | |
| right: -3.5em | |
| top: 2.5em | |
| // 45° clockwise rotation | |
| +rotate(45deg) | |
| +box-shadow(0 0 1em #888) | |
| +background-image(linear-gradient(left, #050, #080, #090, #080, #050)) |