Date: May 30, 2009
- Design is all about dependencies
- If you refer to something, you depend on it.
- Download this application skeleton.
- Convert the app to use AJAX.
- Add any files you changed to your gist and submit your code.
| <!doctype html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
| <link rel="stylesheet" href="main.css"> | |
| <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
| <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
| <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
| </head> |
| //------------------------------------------------------------------------------------------------------------------ | |
| // YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
| //------------------------------------------------------------------------------------------------------------------ | |
| function Animal(name, legs){ | |
| this.name = name, | |
| this.legs = legs | |
| } | |
| Animal.prototype = { | |
| identify: function(){ |
| $stack, $draws = [], {} | |
| def method_missing *args | |
| return if args[0][/^to_/] | |
| $stack << args.map { |a| a or $stack.pop } | |
| $draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
| end | |
| class Array | |
| def +@ |
When using Rails 3.0 and later we already get jquery-rails for free. Look in the gemfile and you'll see:
gem "jquery-rails"You can view the full documentation here: source: https://github.com/indirect/jquery-rails
If you take a look in APP_DIR/app/assets/javascripts/application.js, you'll notice the following lines of code:
This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.
OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.
- Redirect to this link to request GitHub access:
| # Median of an array of numbers | |
| def median(array) | |
| array.each do |element| | |
| if (array.length/2).to_f == (array.length.to_f)/2 | |
| element_even = element.to_i | |
| median_value = (element_even[(array.length/2)].to_f + element_even[(array.length/2) + 1].to_f) / 2 | |
| else | |
| element_odd = element.to_i | |
| median_value = element_odd[(array.length/2) + 1].to_i |
| iced@iced test % cat test.worker | |
| exec 'test.rb' | |
| iced@iced test % cat test.rb | |
| puts config.inspect | |
| puts "YO!" | |
| iced@iced test % iron_worker upload test --worker-config test.json | |
| ------> Creating client | |
| Project 'Test' with id='517baf16ed3d7607990013a0' | |
| ------> Creating code package | |
| Found workerfile with path='test.worker' |