Sunday, 29 December 2013
Sunday, 22 December 2013
Rails Middleware Stack
3.3 Internal Middleware Stack
Much of Action Controller's functionality is implemented as Middlewares. The following list explains the purpose of each of them:
Rack::Sendfile
- Sets server specific X-Sendfile header. Configure this via
config.action_dispatch.x_sendfile_header
option.ActionDispatch::Static
- Used to serve static assets. Disabled if
config.serve_static_assets
isfalse
.Rack::Lock
- Sets
env["rack.multithread"]
flag tofalse
and wraps the application within a Mutex.ActiveSupport::Cache::Strategy::LocalCache::Middleware
- Used for memory caching. This cache is not thread safe.
Rack::Runtime
- Sets an X-Runtime header, containing the time (in seconds) taken to execute the request.
Rack::MethodOverride
- Allows the method to be overridden if
params[:_method]
is set. This is the middleware which supports the PUT and DELETE HTTP method types.ActionDispatch::RequestId
- Makes a unique
X-Request-Id
header available to the response and enables theActionDispatch::Request#uuid
method.Rails::Rack::Logger
- Notifies the logs that the request has began. After request is complete, flushes all the logs.
ActionDispatch::ShowExceptions
- Rescues any exception returned by the application and calls an exceptions app that will wrap it in a format for the end user.
ActionDispatch::DebugExceptions
- Responsible for logging exceptions and showing a debugging page in case the request is local.
ActionDispatch::RemoteIp
- Checks for IP spoofing attacks.
ActionDispatch::Reloader
- Provides prepare and cleanup callbacks, intended to assist with code reloading during development.
ActionDispatch::Callbacks
- Runs the prepare callbacks before serving the request.
ActiveRecord::ConnectionAdapters::ConnectionManagement
- Cleans active connections after each request, unless the
rack.test
key in the request environment is set totrue
.ActiveRecord::QueryCache
- Enables the Active Record query cache.
ActionDispatch::Cookies
- Sets cookies for the request.
ActionDispatch::Session::CookieStore
- Responsible for storing the session in cookies.
ActionDispatch::Flash
- Sets up the flash keys. Only available if
config.action_controller.session_store
is set to a value.ActionDispatch::ParamsParser
- Parses out parameters from the request into
params
.ActionDispatch::Head
- Converts HEAD requests to
GET
requests and serves them as so.Rack::ConditionalGet
- Adds support for "Conditional
GET
" so that server responds with nothing if page wasn't changed.Rack::ETag
- Adds ETag header on all String bodies. ETags are used to validate cache.
API application (using ActionController::API) comes with the following controller modules by default:
- ActionController::UrlFor: Makes url_for and friends available
- ActionController::Redirecting: Support for redirect_to
- ActionController::Rendering: Basic support for rendering
- ActionController::Renderers::All: Support for render :json and friends
- ActionController::ConditionalGet: Support for stale?
- ActionController::ForceSSL: Support for force_ssl
- ActionController::RackDelegation: Support for the request and response methods returningActionDispatch::Request and ActionDispatch::Response objects.
- ActionController::DataStreaming: Support for send_file and send_data
- AbstractController::Callbacks: Support for before_filter and friends
- ActionController::Instrumentation: Support for the instrumentation hooks defined by ActionController (seethe source for more).
- ActionController::Rescue: Support for rescue_from.
- AbstractController::Translation: Support for the l and t localization and translation methods. These delegate to I18n.translate and I18n.localize.
- ActionController::HttpAuthentication::Basic::ControllerMethods (or Digest or Token): Support for basic, digest or token HTTP authentication.
- AbstractController::Layouts: Support for layouts when rendering.
- ActionController::MimeResponds (and ActionController::ImplicitRender for Rails 4): Support for content negotiation (respond_to, respond_with).
- ActionController::Cookies: Support for cookies, which includes support for signed and encrypted cookies. This requires the cookie middleware.
Saturday, 14 December 2013
ruby % things
%r()
is another way to write a regular expression.%q()
is another way to write a single-quoted string (and can be multi-line, which is useful)%Q()
gives a double-quoted string%x()
is a shell command%i()
gives an array of symbols (Ruby >= 2.0.0)
http://stackoverflow.com/questions/1274675/ruby-what-does-warray-mean
Thursday, 12 December 2013
Using a WebSocket to access your CLI
➜ temp wget http://download.websocketd.com/releases/websocketd/0.2.7/darwin_amd64/websocketd
--2013-12-13 14:53:14-- http://download.websocketd.com/releases/websocketd/0.2.7/darwin_amd64/websocketd
Resolving download.websocketd.com... 176.32.98.233
Connecting to download.websocketd.com|176.32.98.233|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5970144 (5.7M) [application/octet-stream]
Saving to: ‘websocketd’
100%[===========================================================>] 5,970,144 962KB/s in 11s
2013-12-13 14:53:27 (551 KB/s) - ‘websocketd’ saved [5970144/5970144]
➜ temp chmod +x websocketd
Test it:
➜ temp ./websocketd --help
websocketd (0.2.7)
websocketd is a command line tool that will allow any executable program
that accepts input on stdin and produces output on stdout to be turned into
a WebSocket server....
create an app
count.sh:
#!/bin/bash
# Count from 1 to 10, pausing for a second between each iteration.
for COUNT in $(seq 1 10); do
echo $COUNT
sleep 1
done
Make it executable:
$ chmod +x ./count.sh
Start the server:
➜ websockets ./websocketd --port=8080 ./count.sh
Fri, 13 Dec 2013 14:58:11 +1100 | INFO | server | | Starting WebSocket server : ws://0.0.0.0:8080/
Fri, 13 Dec 2013 14:58:11 +1100 | INFO | server | | Serving using application : ./count.sh
In a web-page:
var ws = new WebSocket('ws://localhost:8080/');
ws.onmessage = function(event) {
console.log('Count is: ' + event.data);
};
bam:
Server logs:
➜ websockets ./websocketd --port=8080 ./count.sh
Fri, 13 Dec 2013 14:58:11 +1100 | INFO | server | | Starting WebSocket server : ws://0.0.0.0:8080/
Fri, 13 Dec 2013 14:58:11 +1100 | INFO | server | | Serving using application : ./count.sh
Fri, 13 Dec 2013 14:59:38 +1100 | ACCESS | session | url:'http://[::1]:56042/' remote:'localhost' id:'1386907178885478031' origin:'http://www.blogger.com' | CONNECT
Fri, 13 Dec 2013 14:59:48 +1100 | ACCESS | session | url:'http://[::1]:56042/' remote:'localhost' id:'1386907178885478031' origin:'http://www.blogger.com' command:'./count.sh' pid:'46495' | DISCONNECT
test it with --devconsole
./websocketd --port=8080 --devconsole ./count.sh
and open http://localhost:8080/
connect with an javascript WebSocket
create a file count.html:
<!DOCTYPE html>
<html>
<head>
<title>websocketd count example</title>
<style>
#count {
font: bold 150px arial;
margin: auto;
padding: 10px;
text-align: center;
}
</style>
</head>
<body>
<div id="count"></div>
<script>
var ws = new WebSocket('ws://localhost:8080/');
ws.onopen = function() {
document.body.style.backgroundColor = '#cfc';
};
ws.onclose = function() {
document.body.style.backgroundColor = null;
};
ws.onmessage = function(event) {
document.getElementById('count').innerText = event.data;
};
</script>
</body>
</html>
Open this page in your web-browser. It will even work if you open it directly from disk using a
file://
URL.Test it with greeter.sh
make a file greeter.sh
while read LINE
do
echo "Hello $LINE!"
done
and run it
➜ temp ./websocketd --port=8080 --devconsole ./greeter.sh
Fri, 13 Dec 2013 15:30:02 +1100 | INFO | server | | Starting WebSocket server : ws://0.0.0.0:8080/
Fri, 13 Dec 2013 15:30:02 +1100 | INFO | server | | Developer console enable d : http://0.0.0.0:8080/
Fri, 13 Dec 2013 15:30:02 +1100 | INFO | server | | Serving using application : ./greeter.sh
open console
http://localhost:8080/
connect and type your name
send>> "Yannis"
onmessage: Hello "Yannis"!
UPDATE:
use this small example to run remote terminal commands
https://github.com/msroot/SockeTerm
https://github.com/joewalnes/websocketd/wiki/Ten-second-tutorial
Friday, 29 November 2013
The Art of Innovation
["reward success", "celebrate failure", "punish inaction"]
http://www.youtube.com/watch?v=P1RUWa8pC0k
http://www.youtube.com/watch?v=P1RUWa8pC0k
Monday, 28 October 2013
brew ungrade pg to 9.1
➜ local git:(master) ✗ sudo brew install https://raw.github.com/mxcl/homebrew/1c8c93633f446ef0ddff553d5081cd0548c91687/Library/Formula/postgresql.rb
Saturday, 26 October 2013
The journey is the reward
The journey is the reward — there is no destination.
Let go of the “there.” Your focus on the future is keeping you out of the moment, and you're not really living your life. The journey is where the magic happens. The destination is right here, right now.
Let go of the “there.” Your focus on the future is keeping you out of the moment, and you're not really living your life. The journey is where the magic happens. The destination is right here, right now.
Sunday, 11 August 2013
Tuesday, 6 August 2013
Monday, 5 August 2013
Sunday, 4 August 2013
Friday, 2 August 2013
Thursday, 1 August 2013
Wednesday, 31 July 2013
Keyboard Shortcuts for Bash
Ctrl + A | Go to the beginning of the line you are currently typing on |
Ctrl + E | Go to the end of the line you are currently typing on |
Ctrl + L | Clears the Screen, similar to the clear command |
Ctrl + U | Clears the line before the cursor position. If you are at the end of the line, clears the entire line. |
Ctrl + H | Same as backspace |
Ctrl + R | Let’s you search through previously used commands |
Ctrl + C | Kill whatever you are running |
Ctrl + D | Exit the current shell |
Ctrl + Z | Puts whatever you are running into a suspended background process. fg restores it. |
Ctrl + W | Delete the word before the cursor |
Ctrl + K | Clear the line after the cursor |
Ctrl + T | Swap the last two characters before the cursor |
Esc + T | Swap the last two words before the cursor |
Alt + F | Move cursor forward one word on the current line |
Alt + B | Move cursor backward one word on the current line |
Tab | Auto-complete files and folder names |
Monday, 29 July 2013
Saturday, 27 July 2013
javascript Module Pattern example
http://www.adequatelygood.com/JavaScript-Module-Pattern-In-Depth.html
Friday, 26 July 2013
Sunday, 21 July 2013
Tuesday, 16 July 2013
newrelic_rpm with Rails 4 on heroku
There is a bug in newrelics config file
The solution:
1. in config/newrelic.yml
line 46 replace
app_name: <%= ENV["NEW_RELIC_APP_NAME"] %>
view is var in defined in heroku
blah:(master) ✗ heroku config
DATABASE_URL =>
HEROKU_POSTGRESQL_COBALT_URL =>
NEW_RELIC_LICENSE_KEY =>
NEW_RELIC_LOG =>
PAPERTRAIL_API_TOKEN =>
set the var
heroku config:set NEW_RELIC_APP_NAME=new_app
also in ~/.profile
export NEW_RELIC_APP_NAME=my_app
The solution:
1. in config/newrelic.yml
line 46 replace
app_name: <%= ENV["NEW_RELIC_APP_NAME"] %>
view is var in defined in heroku
blah:(master) ✗ heroku config
DATABASE_URL =>
HEROKU_POSTGRESQL_COBALT_URL =>
NEW_RELIC_LICENSE_KEY =>
NEW_RELIC_LOG =>
PAPERTRAIL_API_TOKEN =>
set the var
heroku config:set NEW_RELIC_APP_NAME=new_app
also in ~/.profile
export NEW_RELIC_APP_NAME=my_app
Sunday, 14 July 2013
Saturday, 13 July 2013
fyrebox
Check this out! My friend's awsome service to create quizzes that can be played on Facebook timeline
Made with Node.js and MongoDB
@fyrebox https://www.fyrebox.co/
Made with Node.js and MongoDB
@fyrebox https://www.fyrebox.co/
Friday, 12 July 2013
Tuesday, 2 July 2013
Adapt.js responsive without bootstrap
What is this?
Adapt.js is a lightweight (848 bytes minified) JavaScript file that determines which CSS file to load before the browser renders a page. If the browser tilts or resizes, Adapt.js simply checks its width, and serves only the CSS that is needed, when it is needed.
http://adapt.960.gs/
Adapt.js is a lightweight (848 bytes minified) JavaScript file that determines which CSS file to load before the browser renders a page. If the browser tilts or resizes, Adapt.js simply checks its width, and serves only the CSS that is needed, when it is needed.
http://adapt.960.gs/
// Edit to suit your needs. var ADAPT_CONFIG = { // Where is your CSS? path: 'assets/css/', // false = Only run once, when page first loads. // true = Change on window resize and page tilt. dynamic: true, // Optional callback... myCallback(i, width) callback: myCallback, // First range entry is the minimum. // Last range entry is the maximum. // Separate ranges by "to" keyword. range: [ '0px to 760px = mobile.css', '760px to 980px = 720.css', '980px to 1280px = 960.css', '1280px to 1600px = 1200.css', '1600px to 1920px = 1560.css', '1940px to 2540px = 1920.css', '2540px = 2520.css' ] };
Wednesday, 26 June 2013
Tuesday, 25 June 2013
Single Table Inheritance in Rails
I couldn’t find too much information on Rails awesome built in Single Table Inheritance so I thought I’d write this up for anyone who is interested.
What is Single Table Inheritance?
In a nutshell, STI allows you to create subclasses of a particular database table. Using a single table, you can cast rows to specific objects that extend the base model.
How to create STI relationships in Rails
Lets say we have a model Computer
class Computer < ActiveRecord:Base # in app/models # Fields: # String name # String owner # String manafacturer # String color def default_browser "unknown!" end end
Now, we want to differentiate between Macs and PCs. It doesn’t really make sense to make a different table for each, since they both have pretty much the same columns. Instead we can create a new column,
type
, which tells Rails to use STI on Computer
. Lets look at what the models might look like.class Computer < ActiveRecord:Base # in app/models # Fields: # String name # String owner # String manafacturer # String color # String type def default_browser "unknown!" end end class Mac < Computer # in app/models # this is for Computers with type="Mac" before_save :set_color # Lets say all macs are silver, no point setting these ourselves def set_color self.color = "silver" self.manafacturer = "apple" end # Lets overwrite the default_browser method def default_browser "safari" end end class PC < Computer # in app/models # Lets overwrite the default_browser method def default_browser "ie =(" end end
Anytime Rails opens up the
computer
object, it looks for the subclass corresponding to type. For instance,type="CoolComputer"
corresponds to model CoolComputer < Computer
.
How to use STI Models
To create a new mac, you can do:
m = Mac.new m.name = "kunal's mac" m.owner = "kunal" m.save m # => #<Mac id: 1, name: "kunal's mac", owner: "kunal", manafacturer: "apple", color: "silver", type: "Mac", ...>
Whats even cooler is ActiveRecord queries. Lets say we want all the computers
Computer.all # => [#<Mac id: 1, name: "kunal's mac", owner: "kunal", manafacturer: "apple", color: "silver", type: "Mac", ...>, #<Mac id: 2, name: "anuj's mac", owner: "anuj", manafacturer: "apple", color: "silver", type: "Mac", ...>, #<PC id: 3, name: "bob's pc", owner: "bob", manafacturer: "toshiba", color: "blue", type: "PC", ...>]
Yup, it automatically gives you the correct objects! You can find out the type of a particular object by calling
.type
, is_a?
or .class
Computer.first.type == Mac # true Computer.first.is_a? Mac # true Computer.first.class == Mac # true
If we only want Macs, we can do
Mac.all
Custom Inheritance Column
If you want to use another column instead of type to use for STI, you can simply add this to the top of your model:
set_inheritance_column 'whatever_you want'
Note: If you have a database column named
type
, you can turn off Single Table Inheritance by changing the inheritance column to something other than type
.
Organizing This in Rails
After using STI, I ended up with a bloated models folder because all of the many custom sub models I created were in the models folder. To solve this, I created a folder in models to store all of my computer specific models
* app * models * computer.rb * computers * pc.rb * mac.rb
Rails doesn’t automatically open subfolders in the models folder, so I added in config/application.rb:
# Load Subfolder Models config.autoload_paths += Dir[Rails.root.join('app', 'models', '{**}')]
Cheers,
Kunal
http://blog.thirst.co/post/14885390861/rails-single-table-inheritance
Wednesday, 19 June 2013
Saturday, 15 June 2013
Egghead.io - AngularJS
http://www.youtube.com/watch?v=Lx7ycjC8qjE&list=PLP6DbQBkn9ymGQh2qpk9ImLHdSH5T7yw7
Friday, 14 June 2013
Thursday, 13 June 2013
AngularJS_generator
DOWNLOAD repo
https://github.com/msroot/AngularJS_generator/
TESTING
sudo npm install -g karma
Start the server (it runs on node.js)
karma startAnother tab
karma run
➜ AngularJS_generator git:(master) karma run Chrome 27.0 (Mac): Executed 6 of 6 SUCCESS (0.155 secs / 0.038 secs) ➜ AngularJS_generator git:(master)
Tuesday, 11 June 2013
Tuesday, 4 June 2013
Ember.JS Resources
https://gist.github.com/harisadam/5046520/raw/2558636546bc0cd52314a73e6d62a786e402bd32/Ember.js+resources.md
# Ember.js # [Follow Me on twitter](http://twitter.com/harisadam) ##Deprecated, I recommend emberwatch.com, you will find very usefull stuff ##Videos:## * Architecture overview (old) - http://www.mochaleaf.com/blog/ember-js-revised-architecture-overview/ * Intro to ember.js and the new router api - http://toranbillups.com/blog/archive/2013/01/03/Intro-to-ember-js-and-the-new-router-api/ * Peepcode Fire Up Ember.js - https://peepcode.com/products/emberjs * Seattle Ember.js Meetup Part 1 (Tom Dale - Ember Data) - http://www.youtube.com/watch?v=_6yMxU-_ARs * Seattle Ember.js Meetup Part 2 (Tom Dale - Ember Data Q&A) - http://www.youtube.com/watch?v=TTy1pbXdKJg * Seattle Ember.js Meetup Part 3 (Yehuda Katz - Ember Router) - http://www.youtube.com/watch?v=4Ed_o3_59ME * Seattle Ember.js Meetup Part 4 (Yehuda & Tom - Q&A) - http://www.youtube.com/watch?v=aBvOXnTG5Ag * Ember.js Code-Walkthrough - http://lukaszielinski.de/blog/posts/2013/02/23/ember-dot-js-code-walkthrough-video/ * Getting Started with Ember.js - http://andymatthews.net/read/2012/06/19/Getting-Started-with-Ember.js-slides-and-video-now-available * EmberCamp video channel - https://addepar.com/ember * Ember-EasyForm & Ember-Validations - https://www.youtube.com/watch?v=ZWUjlbN8fvA&feature=player_embedded * RailsCast Emberjs episode 1 - http://railscasts.com/episodes/408-ember-part-1 * RailsCast Emberjs episode 2 - http://railscasts.com/episodes/410-ember-part-2 * Ember Inspector: Live Controllers - https://www.youtube.com/watch?v=18OSYuhk0Yo&hd=1 ##Posts:## * Ember guides - http://emberjs.com/guides/ * Ember blog - http://emberjs.com/blog/ * Ember API - http://emberjs.com/api/ * Ember Data Architecture - https://github.com/emberjs/data/blob/master/ARCHITECTURE.md * Breaking Changes - https://github.com/emberjs/data/blob/master/BREAKING_CHANGES.md * Handlebars documentation - http://handlebarsjs.com/ * Understanding Ember.Object - http://www.cerebris.com/blog/2012/03/06/understanding-ember-object/ * Introducing Ember-EasyForm - http://reefpoints.dockyard.com/ember/2013/02/21/ember-easy-form.html * Speaking With the Ember.js Core Team - http://net.tutsplus.com/articles/interviews/ember-js-core-team-interview/ * Building an Ember app with RailsAPI - Part 1 (coffeesript + rails) - http://reefpoints.dockyard.com/ember/2013/01/07/building-an-ember-app-with-rails-api-part-1.html * Building an Ember app with RailsAPI - Part 2 (coffeesript + rails) - http://reefpoints.dockyard.com/ember/2013/01/09/building-an-ember-app-with-rails-api-part-2.html * Building an Ember app with RailsAPI - Part 3 (coffeesript + rails) - http://reefpoints.dockyard.com/ember/2013/01/10/building-an-ember-app-with-rails-api-part-3.html * Using Rails & Devise with Ember.js - http://say26.com/using-rails-devise-with-ember-js * Documenting our understanding of EmberJS Data - https://gist.github.com/BernardNotarianni/4283607 * Introduction to Ember - http://www.embertraining.com/ * Getting Started With Ember.js - http://twbrandt.github.com/ * Why Discourse uses Ember.js - http://eviltrout.com/2013/02/10/why-discourse-uses-emberjs.html * EMBER.JS DASHBOARD - http://code418.com/ember.js-dashboard/ * Ember Wrap-up - http://bradleypriest.com/tags.html#ember-wrapup-ref * darthdeus vs Ember.js - http://darthdeus.github.com/ * Advice on & Instruction in the Use Of Ember.js - http://trek.github.com/ * Game On: Backbone and Ember - http://net.tutsplus.com/tutorials/javascript-ajax/game-on-backbone-and-ember/ * Use Ember.js as a cross plaform javascript library part 1 - http://cgcardona.github.com/2013/02/18/use-emberjs-as-a-cross-plaform-javascript-library/ * Use Ember.js as a cross plaform javascript library part 2 - http://cgcardona.github.com/2013/02/18/use-emberjs-as-a-cross-plaform-javascript-library-pt2/ * 5 Useful Tips for Ember.js Developers - http://say26.com/five-useful-tips-for-ember-js-developers * Ember.js and Rails Authentication Gotchas - http://blog.waymondo.com/2012-12-18-ember-dot-js-and-rails-authentication-gotchas/ * Getters and Setters in Ember.js - http://emberashes.com/blog/2012/12/23/getters-and-setters-in-ember-dot-js/ * Ember.js Routing - the Director's Cut - http://www.thesoftwaresimpleton.com/blog/2012/08/20/routing_update/ * Ember.js forms made easy with EasyForm - http://thechangelog.com/emberjs-forms-made-easy-with-easyform/ * Rails + Ember.js http://www.devmynd.com/blog/2013-3-rails-ember-js * Debugging Emberjs And Ember data - http://www.akshay.cc/blog/2013-02-22-debugging-ember-js-and-ember-data.html * EmberJS Confuses Me - http://wekeroad.com/2013/03/06/ember-confuses-me * 33 Great Resources to Get Started with Ember.js - http://accidentaltechnologist.com/javascript/33-great-resources-get-started-emberjs/ * Adding Splash Screen to an Ember.js App - http://www.harimenon.com/blog/2013/03/13/adding-splash-screen-to-an-ember-dot-js-app/ * EmberPress - A Letterpress clone in EmberJS - http://emberpress.eviltrout.com/ * Debugging EmberJS and Ember Data - http://www.akshay.cc/blog/2013-02-22-debugging-ember-js-and-ember-data.html ##Presentations:## * Writing Big (ambitious) Apps Using - http://www.rvl.io/shex/ember/ * EMBER.JS & CLIENT SIDE VALIDATIONS - http://www.rvl.io/bcardarella/ember-js-and-clientsidevalidations * Why Ember? - http://mutewinter.github.com/why_ember/#/slides * Optimizing an API for Ember Data - https://speakerdeck.com/dgeb/optimizing-an-api-for-ember-data ##Interesting repositories: ## * Ember auth - https://github.com/heartsentwined/ember-auth * Ember-inspector - https://github.com/stefanpenner/ember-inspector * Query string support for the Ember.js router - https://github.com/alexspeller/ember-query * Ember.js Contacts List example - https://github.com/ivanvanderbyl/contacts * Ember TODO example - https://github.com/Skalar/ember_todo * Internationalization for Emberjs - https://github.com/jamesarosen/ember-i18n * Experiment building Ember.js apps using RailsAPI - https://github.com/bcardarella/ember-railsapi * A simple Rails app for testing CRUD with ember.js and ember-data.js - https://github.com/dgeb/ember_data_example * EmberJS example App with a common CRUD interface - https://github.com/GerritWanderer/ember_data-crud_example * Modal CRUD example - http://jsbin.com/ixigez/2/edit
How to try out the Ember Inspector in Google Chrome
by Kasper Tidemann
Yehuda Katz has been working on Ember Inspector, an extension for Google Chrome that exposes what happens with views, controllers, objects etc. when running an Ember.js application.
There’s already a few videos demonstrating the inspector, including Ember Inspector: Live Controllers. It will be officially available with the release of Ember.js version 1.0, but you can go ahead and try it out now. Here’s a quick guide:
- Go to github.com/tildeio/ember-extension and download the ZIP file
- Unzip the file and fire up Google Chrome
- Visit chrome://flags and enable “Experimental Extension APIs” in the list
- Restart Google Chrome
- Go to the Extensions page and ensure that the “Developer Mode” checkbox is checked
- Click “Load unpacked extension…” and select theember-extension-master folder
- Restart Google Chrome and bring up the Developer Tools
- Click “Ember” at the far right of the tab menu
That’s it. If all went okay, you should be seeing something like this in your Developer Tools menu. Happy inspecting!
(As a side note, in Google Chrome 24.x, it even had a nice, little icon.)
Subscribe to:
Posts (Atom)