Skip to content

Instantly share code, notes, and snippets.

@bojicas
bojicas / index.hbs
Created July 11, 2014 20:10
Todo app section moved into index.hbs template
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>
<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
@bojicas
bojicas / application.hbs
Created July 11, 2014 17:03
Static mockup
<section id="todoapp">
<header id="header">
<h1>todos</h1>
<input type="text" id="new-todo" placeholder="What needs to be done?" />
</header>
<section id="main">
<ul id="todo-list">
<li class="completed">
<input type="checkbox" class="toggle">
@bojicas
bojicas / unicorn.rb
Created July 4, 2014 11:10
config/unicorn.rb
# config/unicorn.rb
# Set the working application directory
# working_directory '/path/to/your/app'
working_directory '/var/www/demo-app'
# Unicorn PID file location
# pid '/path/to/pids/unicorn.pid'
pid '/var/www/demo-app/pids/unicorn.pid'
@bojicas
bojicas / default
Created July 4, 2014 11:07
nginx & unicorn /etc/nginx/sites-available/default
upstream app {
# Path to Unicorn SOCK file, as defined previously
server unix:/tmp/unicorn.demo-app.sock fail_timeout=0;
}
server {
listen 80;
server_name localhost;
# Application root, as defined previously
@bojicas
bojicas / unicorn_init.sh
Created July 4, 2014 11:04
unicorn_init.sh
#!/bin/sh
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/var/www/demo-app
PID=$APP_ROOT/var/www/demo-app/pids/unicorn.pid
CMD="$APP_ROOT/bin/unicorn -D -c $APP_ROOT/config/unicorn.rb -E production"
class Attachment < ActiveRecord::Base
belongs_to :document
has_attached_file :attachment,
:styles => {
:thumb => ["250x250#", 'png']
},
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:path => "/:class/:attachment/:id/:token_document/:style/:filename"