-
The new rake task assets:clean removes precompiled assets. [fxn]
-
Application and plugin generation run bundle install unless
--skip-gemfile
or--skip-bundle
. [fxn] -
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
-
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
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 | |
# Variable DELAYED_JOB_ARGS contains the arguments for delayed jobs for, e.g. defining queues and worker pools. | |
# function that is called when the docker container should stop. It stops the delayed job processes | |
_term() { | |
echo "Caught SIGTERM signal! Stopping delayed jobs !" | |
# unbind traps | |
trap - SIGTERM | |
trap - TERM |
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
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
RewriteEngine On | |
# Force HTTPS - Proto needed for AWS ELB | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker |
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 | |
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462 | |
find . -type f -iname "*.png" -exec optipng -nb -nc {} \; | |
find . -type f -iname "*.png" -exec advpng -z4 {} \; | |
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \; | |
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \; |
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
module RequestMacros | |
def login_user(user = nil) | |
user = create(:user, password: 'password') unless user | |
# ensure password is valid when `user` is provided | |
expect(user.valid_password?('password')).to be(true) | |
# ensure user is confirmed | |
user.confirm! |
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 | |
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
# Inspired from https://gist.github.com/faleev/3435377 | |
# Remove any existing packages: | |
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
# Get the dependencies (Ubuntu Server or headless users): | |
sudo apt-get update |
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
# Model using the ghostscript processor | |
class Content < ActiveRecord::Base | |
has_attached_file :resource, | |
:styles => { :preview => ["725x1200>", :jpg], :thumb => ["100x140>", :jpg] }, | |
:processors => [:ghostscript, :thumbnail], | |
:convert_options => { :all => '-colorspace RGB -flatten -density 300 -quality 100' }, | |
:path => ":page_path/:class/:id/:resource_token/:style/:filename" | |
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 'strong_parameters' | |
class ActiveRecord::Base | |
include ActiveModel::ForbiddenAttributesProtection | |
end | |
class ActionController::Base | |
# Use this with CanCan's load_resource to permit a set of params before | |
# it tries to build or update a resource with them. |
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
# These instructions are for Ruby 1.9.3 under rbenv. | |
# To install ruby-debug19 for ruby-1.9.3 you need to download the following gems from http://rubyforge.org/frs/?group_id=8883 | |
linecache19-0.5.13.gem | |
ruby_core_source-0.1.5.gem | |
ruby-debug19-0.11.6.gem | |
ruby-debug-base19-0.11.26.gem | |
#Then in your console |
NewerOlder