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 Paperclip | |
class ThumbnailWithDimensions < Thumbnail | |
def initialize(file, options = {}, attachment = nil) | |
super | |
attachment.instance_write(:width, @current_geometry.width) | |
attachment.instance_write(:height,@current_geometry.height) | |
end | |
end | |
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
class Category | |
# name is book, movie | |
attr_accessor :name, :path | |
def initialize(n, path) | |
self.name = n.to_s # movie, book | |
self.path = path | |
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
check process sphinx_tiiptop_3312 | |
with pidfile /var/run/sphinx/tiiptop.pid | |
start program = "/engineyard/bin/thinking_sphinx_searchd tiiptop start" as uid deploy and gid deploy | |
stop program = "/engineyard/bin/thinking_sphinx_searchd tiiptop stop" as uid deploy and gid deploy | |
group sphinx_tiiptop |
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
# Sphinx and ThinkingSphinx | |
after "deploy:migrate", "thinking_sphinx:home_made" | |
namespace :thinking_sphinx do | |
task :home_made do | |
# ensure the log directory exist | |
run "mkdir -p /var/log/engineyard/sphinx/#{application}" | |
steps = [:configure, :reindex] | |
run steps.map {|step| "/engineyard/bin/thinking_sphinx_searchd #{application} #{step}"}.join(' && ') |
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
check process sphinx_<app_name>_3312 | |
with pidfile /var/run/sphinx/<app_name>.pid | |
start program = "/engineyard/bin/thinking_sphinx_searchd <app_name> start" as uid <user_name> and gid <user_group> | |
stop program = "/engineyard/bin/thinking_sphinx_searchd <app_name> stop" as uid <user_name> and gid <user_group> | |
group sphinx_<app_name> |
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 'rubygems' | |
require 'right_aws' | |
i = 1 | |
path = '/Users/pierre/Desktop/items/pictures/**/*' | |
s3 = RightAws::S3.new(access_key, secret_key) | |
s3_bucket = s3.bucket('twistip', false, 'public-read') | |
headers = {'Content-type' => 'image/jpeg', 'Expires' => "Thu, 01 Jul 2019 08:37:04 GMT", 'Cache-Control' => 'public, max-age=315360000'} |
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
attr_accessor :attachment64 | |
before_validation :save_attachment64 | |
has_attached_file :attachment, :storage => :s3, :s3_credentials => "#{RAILS_ROOT}/config/aws.yml", | |
:path => "messages_images/:id/:style/:filename", | |
:styles => { :original => ['1000x600>'], | |
:normal => ['500x500>'], | |
:stack => ['137x133>'] | |
}, |
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
// | |
// UAPushNotification.m | |
// MyEarth | |
// | |
// Created by Pierre Valade on 08/07/10. | |
// Copyright 2010 Pierre Valade. All rights reserved. | |
// | |
#import "UAPushNotification.h" |
OlderNewer