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 'rubygems' | |
| require 'open-uri' | |
| require 'hpricot' | |
| require 'test/unit' | |
| class HpricotTest < Test::Unit::TestCase | |
| def assert_selector_is_found(page, selector, message = nil) | |
| message ||= "Expected to find elements to match selector: #{selector}" | |
| elements = (page / selector) | |
| assert(elements.any?, message) |
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
| <div class="list"> | |
| <ul> | |
| <% @items.each do |item| %> | |
| <li class="<%= item_classes_for_user(item, @current_user) %>"> | |
| <%= image_tag "/icons/#{item.state}.png" %> | |
| <span class="name"> | |
| <%= item.name %> | |
| </span> | |
| </li> | |
| <% 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
| REGEX: (^|, )([^,\{\};\n\t(\/*)]+) | |
| CSS: | |
| /* ---- | |
| Foobar | |
| */ | |
| body { | |
| font: 14px Arial,Helvetica,Sans-serif; | |
| line-height: 1.5; |
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
| function update() { | |
| timer += deltaTime; | |
| if (state == holstered && timer >= holsterTime) { | |
| timer = 0; | |
| state = aiming; | |
| } else if (state == aiming && timer >= aimTime) { | |
| timer = 0; | |
| state = firing; | |
| } else if (state == firing && timer >= fireTime) { |
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
| =erl_crash_dump:0.1 | |
| Mon Oct 19 18:12:44 2009 | |
| Slogan: init terminating in do_boot () | |
| System version: Erlang R13B02 (erts-5.7.3) [source] [smp:2:2] [rq:2] [async-threads:30] [kernel-poll:true] | |
| Compiled: Mon Oct 19 16:47:43 2009 | |
| Atoms: 5435 | |
| =memory | |
| total: 3327000 | |
| processes: 392300 | |
| processes_used: 388996 |
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
| CKURL *url = create(CKURL); | |
| curl_setURL(url, cstring_text(urlString)); | |
| dispose(urlString); | |
| CKMemory *document = (CKMemory *)curl_fetch(url, 60); | |
| if (!document) { | |
| cobject_error(self, 3, "Failed to load URL: %s", curl_text(url)); | |
| } | |
| cstream_open(document, CK_ReadOnly); |
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
| Processing Admin::WelcomeController#login (for 76.21.101.153 at 2009-10-25 14:15:01) [GET] | |
| Parameters: {"action"=>"login", "controller"=>"admin/welcome"} | |
| Rendering template within layouts/application | |
| Rendering admin/welcome/login | |
| Completed in 6ms (View: 4, DB: 1) | 200 OK [http://enlightenedshadows.com/admin/login] | |
| /!\ FAILSAFE /!\ Sun Oct 25 14:15:10 -0500 2009 | |
| Status: 500 Internal Server Error | |
| undefined method `rewind' for #<UNIXSocket:0xc17a94c> | |
| /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/request.rb:142:in `POST' | |
| /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:15:in `call' |
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 Device < ActiveRecord::Base | |
| has_many :reminders | |
| acts_as_pushable :token | |
| def self.send_reminders | |
| last_push = Settings.last_push || Time.at(0) | |
| Settings.last_push = Time.now | |
| schedules = Schedule.all :conditions => ['schedules.time >= ?', last_push], :include => { :reminder => :device } |
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 Ship extends SpaceObject { | |
| // Degrees per second | |
| var turnRate:float = 90; | |
| // velocity change per second | |
| var thrustForce:float = 200; | |
| var thrusterPos:Vector3 = Vector3.zero; | |
| var thrusterPrefab:GameObject; | |
| private var thrusterParticleEmitter:ParticleEmitter; |
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
| (function() { | |
| var s = true, | |
| t = false, | |
| aa = window, | |
| u = undefined, | |
| v = Math, | |
| ba = "push", | |
| fa = "slice", | |
| ga = "cookie", | |
| y = "charAt", |