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
This plugin for Merb and Rails provides a simple and extremely flexible way to upload files. | |
ORM Support: ActiveRecord, DataMapper, Sequel, MongoMapper | |
Storage Support: S3, MongoDB's GridFS, filesystem... | |
Oh yeah and works with RMagick, ImageScience, MiniMagic | |
http://github.com/jnicklas/carrierwave/ |
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
sys: require("sys") | |
require.paths.unshift "/Users/jonahfox/src/mongoose" | |
mongoose: require('mongoose').Mongoose | |
mongoose.model 'User', { | |
properties: ['nick', 'pass', 'email', 'updated_at'] | |
indexes: [[{ nick: 1 }, {unique: true}]] | |
setters: {} |
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
exports.I18n = | |
en: | |
title: "Free YouTube video download" | |
navi: | |
home: "Home" | |
howto: "Tutorial" | |
blog: "Blog" | |
termsofuse: "Terms of Use" | |
support: "Support" | |
imprint: "Imprint" |
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
Processing PagesController#menu_items (for 94.255.239.201 at 2011-03-28 16:14:48) [GET] | |
Parameters: {"website_id"=>"56", "language"=>"se", "id"=>"1109", "div_id"=>"menu"} | |
Page Load (0.1ms) SELECT * FROM `pages` WHERE (`pages`.`id` = 0) AND (deleted = 0) | |
User Load (0.1ms) SELECT * FROM `users` WHERE (`users`.`id` = 15) | |
TranslatedPageAttribute Load (0.1ms) SELECT * FROM `translated_page_attributes` WHERE (`translated_page_attributes`.`language_short_code` = 'se' AND `translated_page_attributes`.`attribute_name` = 'title') AND (`translated_page_attributes`.page_id = 1105) LIMIT 1 | |
Page Load (0.1ms) SELECT * FROM `pages` WHERE (`pages`.`id` = 1109) AND (deleted = 0) | |
Page Load (1.9ms) SELECT * FROM `pages` WHERE (`pages`.parent_id = 1105) AND (deleted = 0) ORDER BY position asc | |
Menu Load (1.8ms) SELECT * FROM `menus` WHERE (`menus`.`look_id` = 140 AND `menus`.`for_html_id` = 'menu') LIMIT 1 | |
Rendered pages/_menu_page (6.4ms) | |
Page Load (2.0ms) SELECT * FROM `pages` WHERE (website_id = |
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 'test_helper' | |
require 'minitest/autorun' | |
class MiniTest::Spec | |
include ActiveSupport::Testing::SetupAndTeardown | |
include ActiveRecord::TestFixtures | |
alias :method_name :__name__ if defined? :__name__ | |
self.fixture_path = File.join(Rails.root, 'test', 'fixtures') | |
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
require 'growl' | |
require 'open3' | |
ENV["WATCHR"] = "1" | |
$spec_cmd = "env RSPEC_COLOR=true spec --drb --colour --format nested" | |
$cuke_cmd = "cucumber --color --drb --require features/step_definitions --require features/support" | |
$pass = File.join(File.expand_path(File.dirname(__FILE__)), '.watchr_images', 'pass.png') | |
$fail = File.join(File.expand_path(File.dirname(__FILE__)), '.watchr_images', 'fail.png') | |
$pending = File.join(File.expand_path(File.dirname(__FILE__)), '.watchr_images', 'pending.png') |
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
# include this in application controller | |
module Authentication | |
protected | |
# Inclusion hook to make #current_user and #signed_in? | |
# available as ActionView helper methods. | |
def self.included(base) | |
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method | |
end | |
# Returns true or false if the user is signed in. |
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
# Basic tagging system for mongoid documents. | |
# jpemberthy 2010 | |
# | |
# class User | |
# include Mongoid::Document | |
# include Mongoid::Document::Taggable | |
# end | |
# | |
# @user = User.new(:name => "Bobby") | |
# @user.tag_list = "awesome, slick, hefty" |
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 'sinatra/base' | |
module Sinatra | |
# module to catch Sinatra errors and send a email | |
module ExceptionMailer | |
def initialize(app) | |
@app = app | |
# set parameters here.. | |
yield self if block_given? | |
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
require 'test_helper' | |
require 'minitest/autorun' | |
class MiniTest::Spec | |
include ActiveSupport::Testing::SetupAndTeardown | |
include ActiveRecord::TestFixtures | |
alias :method_name :__name__ if defined? :__name__ | |
self.fixture_path = File.join(Rails.root, 'test', 'fixtures') | |
end |