This file contains 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
-- Recive a HTTP POST and relay it | |
-- Author: Waqas Hussain | |
-- Derived from mod_post_msg by Kim Alvefur <[email protected]> | |
-- Some code borrowed from mod_webpresence | |
-- | |
-- Example usage: | |
-- curl http://example.com:5280/presence/user -d "Hello there" | |
-- or | |
-- curl http://example.com:5280/presence/[email protected] -d "Hello there" |
This file contains 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 SessionController < ApplicationController | |
def index_attempt_one | |
if !session[:unset_key] | |
redirect_to :action => 'login' | |
end | |
# Anything here gets executed too! D-: | |
end | |
def index_attempt_two | |
if !session[:unset_key] |
This file contains 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
NoMethodError in Support_calls#new | |
Showing c:/Users/james/code/support/app/views/support_calls/_form.html.erb where line #28 raised: | |
undefined method `resolved' for #<SupportCall:0x1254fcd> | |
Extracted source (around line #28): | |
25: </div> | |
26: <div class="checkbox"> |
This file contains 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 SupportCallsController < ApplicationController | |
def new | |
@support_call = SupportCall.new | |
@customers = Customer.all | |
end | |
def create | |
@support_call = SupportCall.new(params[:support_call]) | |
respond_to do |format| |
This file contains 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
NoMethodError in Support callsController#new | |
undefined method `set_employee_id' for #<SupportCall:0x7740f6> | |
Rails.root: c:/Users/denton/code/billing | |
Application Trace | Framework Trace | Full Trace | |
app/controllers/support_calls_controller.rb:4:in `new' | |
Request |
This file contains 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
c:\Users\james\code\test>rails generate migration RemoveDateCalled | |
NoMethodError: undefined method `[]=' for nil:NilClass | |
Application at c:/Users/james/code/test/config/application.rb:43 | |
Test at c:/Users/james/code/test/config/application.rb:10 | |
(root) at c:/Users/james/code/test/config/application.rb:9 | |
require at org/jruby/RubyKernel.java:1038 | |
(root) at c:/Users/james/code/test/config/application.rb:15 | |
require at org/jruby/RubyKernel.java:1038 | |
(root) at script/rails:6 |
This file contains 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
<h1><%= session[:employee_first_name] %>'s call queue</h1> | |
<%= @foo %> | |
<ul> | |
<% last_date = '' %> | |
<% @employee.support_calls.reverse.each do |call| %> | |
<% date = call.created_at.strftime('%x') %> | |
<% if last_date != date %> | |
<div class="date"><%= date %></div> The date should only appear when it's different from the last one. | |
<% end %> | |
<li><%= link_to call.customer.name + ' - ' + call.caller + ' - ' + call.problem.truncate(32), edit_support_call_path(call) %></li> |
This file contains 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 VehiclesController < ApplicationController | |
# GET /vehicles | |
def index | |
@vehicles = Vehicles.all | |
end | |
end |
This file contains 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
>jruby test-dm.rb | |
Connecting with DataMapper | |
DataObjects::URI.new with arguments is deprecated, use a Hash of URI components | |
(C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:231:in `normalized_uri') | |
NoMethodError: undefined method `blank?' for "":String | |
select_statement at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-sqlserver-adapter-1.1.0/lib/dm-sqlserver-adapter/adapter.rb:48 | |
read at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:137 | |
read at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/repository.rb:162 | |
lazy_load at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/collection.rb:1117 | |
each at C:/dev/jruby-1.6.2/lib/ruby/gems/1.8/gems/dm-core-1.1.0/lib/dm-core/support/lazy_array.rb:409 |
This file contains 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
from twisted.web.server import Site | |
from twisted.web.resource import Resource, IResource | |
from twisted.internet import reactor, task | |
class Customer(Resource): | |
def __init__(self, customer_id=100): | |
Resource.__init__(self, customer_id) | |
self.customer_id = customer_id | |
def render_GET(self, request): |
OlderNewer