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
# The GraphicsMagick action, dependent on the `gm` command, is able to perform | |
# any number of GraphicsMagick conversions on an image passed in as an input. | |
# The options hash should specify the +name+ for the particular step (which is | |
# appended to the resulting image filename) the +command+ (eg. convert, mogrify), | |
# the +options+ (to the command, eg. -shadow -blur), and the +extension+ which | |
# will determine the resulting image type. Optionally, you may also specify | |
# +input+ as the name of a previous step; doing this will use the result of | |
# that step as the source image, otherwise each step uses the original image | |
# as its source. | |
class GraphicsMagick < CloudCrowd::Action |
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
# encoding: utf-8 | |
source :gemcutter | |
source 'http://gems.github.com' | |
# Rails 2.x style. | |
group :rails do | |
gem 'rails', '~> 2.3.5', :require => nil | |
gem 'builder', '~> 2.1.2' | |
gem 'memcache-client', '>= 1.7.4', :require => nil | |
gem 'tzinfo', '~> 0.3.12' |
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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
# - a browser with WebSocket support | |
# | |
# Usage: | |
# ruby redis_pubsub_demo.rb | |
# |
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
DB = { | |
:redis => SITE_REDIS, | |
:geo => GEO | |
} | |
SITES = DB[:redis].smembers("sites").inject({}) do |sum, site| | |
sum[site] = JSON.parse(DB[:redis]["site:#{site}"]) | |
sum | |
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
module FCG | |
module Client | |
module Comment | |
# sort attributes | |
ATTRIBUTES = [:site, :record, :body, :body_as_html, :deleted, :flagged_by, :depth, :path, :parent_id, :displayed_name, :user_id] | |
module ClassMethods | |
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 CommentsController < ApplicationController | |
before_filter :require_user | |
def index | |
@comments = Comment.all | |
end | |
def new | |
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
module FCG::Service | |
class AlbumApp < FCG::Service::Base | |
include FCG::Rest | |
restful :search => true | |
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
# Add your own tasks in files placed in lib/tasks ending in .rake, | |
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | |
require File.expand_path('../config/application', __FILE__) | |
require 'rake' | |
require 'rake/testtask' | |
require 'rake/rdoctask' | |
Rails::Application.load_tasks |
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
jQuery(function ($) { | |
var csrf_token = $('meta[name=csrf-token]').attr('content'), | |
csrf_param = $('meta[name=csrf-param]').attr('content'); | |
$.fn.extend({ | |
/** | |
* Triggers a custom event on an element and returns the event result | |
* this is used to get around not being able to ensure callbacks are placed | |
* at the end of the chain. | |
* |
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 FCG | |
module Rest | |
attr_accessor :model | |
module ClassMethods | |
def restful(*args) | |
options = args.extract_options! | |
opts = { | |
:only => [:get, :post, :put, :delete], | |
:search => false | |
}.merge(options) |
OlderNewer