Skip to content

Instantly share code, notes, and snippets.

View tanelsuurhans's full-sized avatar

Tanel Suurhans tanelsuurhans

  • ID.me
  • United States
View GitHub Profile
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) {
after_transition :ordered => :locked, :do => :send_confirmation
after_transition :ordered => :completed, :do => :send_confirmation
#!/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() {
class Foo
def initialize(attributes = {})
attributes.each do |key, value|
send("#{key}=", value)
end and return self
end
end
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
$(document).ready(function() {
 $('.button').click(function(){
   $(this).addClass('down');
 });
 $('.button').mouseover(function(){
   $(this).addClass('over');
 });
 $('.button').mouseout(function(){
   $(this).removeClass('over');
 });
def reject_purchase_items(attributes)
if attributes["quantity"] == "0"
if attributes["id"].blank?
return true
else
attributes["_destroy"] = true
end
end
false
# 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
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 >
require ::File.expand_path('../config/environment', __FILE__)
use FlashSessionCookie
run Shoperb::Application