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
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
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
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
# configure these defaults based on Your needs : | |
JS_FILES_DIR = 'public/javascripts' # the javascripts base directory | |
EXCLUDED_JS_FILES = %W{ cache/* test/* } # excluded from compilation | |
OUT_FILE_JS_EXT_PREFIX = ".min" # override with `rake ... OUT_EXT=_pack` | |
COMPILER_JAR = "lib/jars/build/compiler.jar" # adjust the jar path ! | |
# only required if running under JRuby - will compile multiple files | |
# faster as it does not need to run system `java -jar ...` commands. | |
COMPILER_MAIN_CLASS = "com.google.javascript.jscomp.CommandLineRunner" |
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 is an incomplete implementation. | |
module MongoMapper | |
module NestedAttributes | |
def self.included(base) | |
base.extend(ClassMethods) | |
base.send :include, InstanceMethods | |
end | |
module ClassMethods | |
def accepts_nested_attributes_for(*attr_names) |
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 'pp' | |
require 'rubygems' | |
require 'mongo_mapper' | |
MongoMapper.database = 'testing' | |
class Rating | |
include MongoMapper::EmbeddedDocument | |
key :user_id, ObjectId |
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
# To use: | |
# rails project_name -m http://gist.github.com/raw/401285/963cbb5d75644d545d0b81be02b1656b365932e7/rails-template.rb | |
# download helper | |
require 'net/http' | |
def download(url, target_dir = "") | |
domain = url.match(/:\/\/([a-z\.]*)/)[1] | |
filename = url.match(/\/([a-z\.]*)$/)[1] | |
path = url.match(/:\/\/[a-z\.]*(.*)/)[1] |
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
tell application "System Events" | |
if exists process "Skype" then | |
tell application "Skype" | |
send command "SET USERSTATUS ONLINE" script name "AppleScript status setter" | |
end tell | |
end if | |
end tell | |
-- "MODES": ONLINE, DND, AWAY |
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 Harmony | |
# Allows accessing config variables from harmony.yml like so: | |
# Harmony[:domain] => harmonyapp.com | |
def self.[](key) | |
unless @config | |
raw_config = File.read(RAILS_ROOT + "/config/harmony.yml") | |
@config = YAML.load(raw_config)[RAILS_ENV].symbolize_keys | |
end | |
@config[key] | |
end |