Skip to content

Instantly share code, notes, and snippets.

# Patch Paperclip reprocess! and to_file methods to use binary mode (for Windows compatibility)
# Fixup content type on assignment
# Ensure the :original style is always processed first
module Paperclip
module Storage
module Filesystem
def to_file style = default_style
@queued_for_write[style] || (File.new(path(style), 'rb') if exists?(style))
end
alias_method :to_io, :to_file
@thewebfellas
thewebfellas / nginx.conf
Created January 28, 2009 16:19
sample nginx.conf for thin
user nginx;
worker_processes 5;
error_log /var/log/nginx.error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@thewebfellas
thewebfellas / nginx
Created January 28, 2009 16:14
init script for nginx
#! /bin/sh
# Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and
# run 'sudo update-rc.d nginx defaults', or use the appropriate command on your
# distro.
#
# Author: Ryan Norbauer <ryan.norbauer@gmail.com>
# Modified: Geoffrey Grosenbach http://topfunky.com
#