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
D, [2011-12-01T11:52:43.152594 #19862] DEBUG -- : NEW JID: status@ais/blather | |
D, [2011-12-01T11:52:43.154074 #19862] DEBUG -- : SENDING: (/home/james/.rvm/gems/ruby-1.9.2-p290/gems/blather-0.5.9/lib/blather/stream/client.rb:21:in `start') <stream:stream to='ais' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en' > | |
D, [2011-12-01T11:52:43.157814 #19862] DEBUG -- : | |
------------------------------ | |
D, [2011-12-01T11:52:43.157916 #19862] DEBUG -- : STREAM IN: <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='9b3094cb-0b64-4eda-9779-cbec3b26b5b7' from='ais' version='1.0' xml:lang='en'><stream:features><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechanism><mechanism>PLAIN</mechanism></mechanisms><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><auth xmlns='http://jabber.org/features/iq-auth'/></stream:features> | |
D, [2011-12-01T11:52:43.158968 #19862] DEBUG -- : RECEIVING (str |
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.internet import reactor, task | |
from twisted.web.server import Site | |
from twisted.web import server | |
from twisted.web.resource import Resource | |
import time | |
class ClockPage(Resource): | |
isLeaf = True | |
def __init__(self): | |
self.presence=[] |
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
Unhandled Error | |
Traceback (most recent call last): | |
File "sscce.py", line 32, in <module> | |
reactor.run() | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1162, in run | |
self.mainLoop() | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1171, in mainLoop | |
self.runUntilCurrent() | |
--- <exception caught here> --- | |
File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 766, in runUntilCurrent |
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
require 'System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' | |
include System::DirectoryServices | |
class WinManager | |
attr_accessor :connection_string | |
if !defined? FLAG_CANNOT_CHANGE_PASSWORD | |
FLAG_CANNOT_CHANGE_PASSWORD = 0x40 | |
FLAG_PASSWORD_NEVER_EXPIRES = 0x10000 |
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
$('.submittable').live('change', function() { | |
$(this).parents('form:first').submit(); | |
}); |
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
<%= form_for([@customer, @phone]) do |f| %> | |
<% if @phone.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@phone.errors.count, "error") %> prohibited this phone from being saved:</h2> | |
<ul> | |
<% @phone.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
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
# app/models/phone.rb | |
class Phone < ActiveRecord::Base | |
# t.integer "customer_id" | |
# t.integer "number" | |
# t.integer "number_type" | |
belongs_to :customer | |
Number_type_choices = {0 => 'Home', 1 => 'Work', 2 => 'Cell'} |
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
# TODO: this will fail when run on a project that uses namespaced models | |
desc "Show visibility of attributes" | |
task :attr => :environment do | |
require 'set' | |
models = Dir['**/models/**/*.rb'].map {|f| File.basename(f, '.*').camelize.constantize } | |
models.each do |m| | |
all = Set.new m.attribute_names | |
accessible = Set.new m.accessible_attributes.to_a | |
protected_ = Set.new m.protected_attributes.to_a |
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
<%= semantic_form_for([@customer, @phone]) do |f| %> | |
<%= f.semantic_errors :state %> | |
<%= f.inputs do %> | |
<%= f.input :number, as: :string, input_html: { maxlength: 18 }%><br /> | |
<%= f.input :extension, as: :number %><br /> | |
<%= f.input :number_type, as: :select, collection: Phone.number_type_name_options %> | |
<% end -%> | |
<%= f.actions %> | |
<% 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
vagrant@lucid32:/vagrant$ rails new sample | |
create | |
/home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /vagrant/sample (Errno::EACCES) | |
from /home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir' | |
from /home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p' | |
from /home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each' | |
from /home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p' | |
from /home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:205:in `each' | |
from /home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p' | |
from /home/vagrant/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:51:in `block in invoke!' |