This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: mongodb | |
| # Required-Start: $all | |
| # Required-Stop: $all | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: starts the mongodb data-store | |
| # Description: starts mongodb using start-stop-daemon |
| # First the end result of what we want: | |
| class Foo | |
| before_hook :whoa | |
| before_hook :amazing | |
| def test | |
| puts "This is kinda cool!" | |
| end |
| // This document distills the magic that happens when you create a file with the ".jst" | |
| // and ".ejs" extensions anywhere on your asset path in Ruby on Rails, courtesy of the | |
| // Sprockets library (https://github.com/sstephenson/sprockets). | |
| // | |
| // For the purpose of this example, imagine that you have created a template for | |
| // messages in `app/assets/javascripts/backbone/templates/messages/message.jst.ejs` | |
| // with the following contents: | |
| // | |
| // <h1><%= user.full_name %></h1> | |
| // <p><%= body %></p> |
| require 'rubygems' | |
| require 'bundler' | |
| Bundler.require | |
| require './application' | |
| namespace :assets do | |
| desc 'compile assets' | |
| task :compile => [:compile_js, :compile_css] do | |
| end |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
The rules for how Ember.js evaluates Handlebars templates have recently changed, and you may need to update your application's templates to ensure they continue working..
Remember that a template is always evaluated against a context object. When you render a template, values are looked up from that object. For example:
Hello, {{firstName}} {{lastName}}!| # Environment, set GEM_HOME & GEM_PATH. For example, we can launch JRuby like this: | |
| # GEM_HOME=/Users/amurray/tmp/gems/ GEM_PATH=/Users/amurray/tmp/gems java -jar ~/Downloads/jruby-complete-1.7.0.preview1.jar -S irb | |
| # ===================== | |
| # LISTING gems | |
| puts Gem::Specification.find_all.to_s | |
| puts Gem::Specification.find_all.map{|spec| "#{spec.name} (#{spec.version})" } | |
| # ===================== | |
| # USING (a specific version of) gems |
| class MultiLogger | |
| attr_reader :level | |
| def initialize(args={}) | |
| @level = args[:level] || Logger::Severity::DEBUG | |
| @loggers = [] | |
| Array(args[:loggers]).each { |logger| add_logger(logger) } | |
| end |