This file contains hidden or 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
| protected override void Draw(GameTime gameTime) { | |
| this.GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.PowderBlue, 1.0f, 0); | |
| effect.CurrentTechnique = effect.Techniques["Simple"]; | |
| effect.Parameters["World"].SetValue(Matrix.CreateTranslation(new Vector3(0, 0, -20))); | |
| effect.Parameters["View"].SetValue(this.camera.View); | |
| effect.Parameters["Projection"].SetValue(this.camera.Projection); | |
| effect.Parameters["TextureFile"].SetValue(this.texture); | |
| foreach (EffectPass pass in effect.CurrentTechnique.Passes) { |
This file contains hidden or 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
| after_transition :ordered => :locked, :do => :send_confirmation | |
| after_transition :ordered => :completed, :do => :send_confirmation |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # This script starts and stops the Resque daemon | |
| # This script belongs in /engineyard/bin/resque | |
| # | |
| PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH | |
| CURDIR=`pwd` | |
| usage() { |
This file contains hidden or 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
| class Foo | |
| def initialize(attributes = {}) | |
| attributes.each do |key, value| | |
| send("#{key}=", value) | |
| end and return self | |
| end | |
| end |
This file contains hidden or 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
| class User | |
| has_many :city_users | |
| has_many :cities, :through => :city_users | |
| end | |
| class City | |
| has_many :city_users | |
| has_many :users, :through => :city_users | |
| end |
This file contains hidden or 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
| $(document).ready(function() { | |
| $('.button').click(function(){ | |
| $(this).addClass('down'); | |
| }); | |
| $('.button').mouseover(function(){ | |
| $(this).addClass('over'); | |
| }); | |
| $('.button').mouseout(function(){ | |
| $(this).removeClass('over'); | |
| }); |
This file contains hidden or 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
| def reject_purchase_items(attributes) | |
| if attributes["quantity"] == "0" | |
| if attributes["id"].blank? | |
| return true | |
| else | |
| attributes["_destroy"] = true | |
| end | |
| end | |
| false |
This file contains hidden or 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 what I'd _like_ to do. | |
| # link_to user_album(user, album) | |
| # link_to user_blog(user) | |
| resources :users, :path => '' do | |
| resources :albums | |
| resources :blogs | |
| end |
This file contains hidden or 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
| ruby-1.9.2-p180 :023 > if bar; puts "yo"; end | |
| yo | |
| => nil | |
| ruby-1.9.2-p180 :024 > if bar.present?; puts "yo"; end | |
| => nil | |
| ruby-1.9.2-p180 :025 > |
This file contains hidden or 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 ::File.expand_path('../config/environment', __FILE__) | |
| use FlashSessionCookie | |
| run Shoperb::Application |