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
| module StefansAssignment | |
| def self.included(base) | |
| base.class_eval do | |
| extend ClassMethods | |
| include InstanceMethods | |
| end | |
| end | |
| module ClassMethods | |
| def model_accesible(*models) |
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
| " ir_black color scheme | |
| " More at: http://blog.infinitered.com/entries/show/8 | |
| " ******************************************************************************** | |
| " Standard colors used in all ir_black themes: | |
| " Note, x:x:x are RGB values | |
| " | |
| " normal: #f6f3e8 | |
| " |
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 'wirble' | |
| require 'fileutils' | |
| # Colorize | |
| Wirble.init | |
| Wirble.colorize | |
| # I use vim | |
| alias q exit |
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
| test = "Delivered-To: [email protected] | |
| Received: by 10.114.155.8 with SMTP id c8cs261037wae; | |
| Thu, 22 Jan 2009 18:13:17 -0800 (PST) | |
| MIME-Version: 1.0 | |
| Sender: [email protected] | |
| Received: by 10.114.92.14 with SMTP id p14mr4207993wab.140.1232676797484; Thu, | |
| 22 Jan 2009 18:13:17 -0800 (PST) | |
| Date: Thu, 22 Jan 2009 20:13:17 -0600 | |
| X-Google-Sender-Auth: ac619f32b7c737b4 |
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
| Factory.define :role do |role| | |
| role.name 'admin' | |
| end | |
| Factory.define :admin, :class => User do |user| | |
| user.email { Factory.next :email } | |
| user.password "password" | |
| user.password_confirmation "password" | |
| user.roles { |a| [a.associations(:role)] } | |
| 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
| irb(main):001:0> require 'openssl' | |
| => true | |
| irb(main):002:0> Digest | |
| NameError: uninitialized constant Digest | |
| from /opt/local/share/java/jruby/lib/ruby/1.8/irb/ruby-token.rb:102:in `const_missing' | |
| from (irb):3:in `irb_binding' | |
| Maybe IRB bug!! |
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
| [stefan@MBP ~] sudo jgem install glassfish --source http://gems.rubyforge.org/ | |
| Successfully installed glassfish-0.9.2-universal-java | |
| 1 gem installed | |
| Installing ri documentation for glassfish-0.9.2-universal-java... | |
| Installing RDoc documentation for glassfish-0.9.2-universal-java... | |
| [stefan@MBP ~] ls | |
| README app coverage.data doc log script tmp | |
| Rakefile config db lib public test vendor | |
| [stefan@MBP ~] glassfish -e jdevelopment | |
| com/sun/enterprise/glassfish/bootstrap/ASMainStatic.java:46:in `run': java.lang.RuntimeException: java.lang.RuntimeException: the domain directory is not writable. (NativeException) |
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
| (1) [stefan@MBP ~] java -version | |
| java version "1.6.0_07" | |
| Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153) | |
| Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode) | |
| [stefan@MBP ~] sudo glassfish -e jdevelopment | |
| Feb 2, 2009 12:16:18 PM com.sun.enterprise.glassfish.bootstrap.ASMainStatic findDerbyClient | |
| INFO: Cannot find javadb client jar file, jdbc driver not available | |
| Exception in thread "Static Framework Launcher" java.lang.TypeNotPresentException: Type javax.xml.stream.XMLInputFactory not present | |
| at sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:27) |
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
| # Plist patch for Ruby 1.9.1 | |
| # Version: 3.0.0 | |
| # seems its just the change in case statement syntax | |
| # broken | |
| def self.element_type(item) | |
| return case item | |
| when String, Symbol: 'string' | |
| when Fixnum, Bignum, Integer: 'integer' | |
| when Float: 'real' |
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 'scxml' | |
| xml_string = %Q{ | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <root> | |
| <elements> | |
| <element id="0">a</element> | |
| <element id="1">b</element> | |
| <element id="2">c</element> | |
| </elements> |