Skip to content

Instantly share code, notes, and snippets.

View gnumarcelo's full-sized avatar

Marcelo Menezes gnumarcelo

View GitHub Profile
@gnumarcelo
gnumarcelo / unicorn.rb
Last active August 29, 2015 14:07 — forked from rkjha/unicorn.rb
root = "/home/mrhuman/apps/YOUR_APP_NAME/current"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/unicorn.log"
stdout_path "#{root}/log/unicorn.log"
# change the YOUR_APP_NAME to your application name
listen "/tmp/unicorn.YOUR_APP_NAME.sock"
worker_processes 2
timeout 30
#!/bin/sh
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/home/mrhuman/apps/YOUR_APP_NAME/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E production"
AS_USER=mrhuman
set -u
# https://github.com/gzigzigzeo/carrierwave-meta
# Integrating CarrierWave with JCrop
# Let implement the behavior like at this demo: deepliquid.com/projects/Jcrop/demos.php?demo=thumbnail
# The uploader:
class CropUploader < SobakaUploader
include CarrierWave::Meta
# Crop source is a source image converted from original which could be bigger than source area (left image in the example).
version :crop_source do