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 'autotest/redgreen' | |
require 'autotest/timestamp' | |
module Autotest::Growl | |
def self.growl title, msg, img, pri=0, sticky="" | |
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}" | |
end | |
Autotest.add_hook :ran_command do |at| |
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
# This file is copied to ~/spec when you run 'ruby script/generate rspec' | |
# from the project root directory. | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) | |
require 'spec/autorun' | |
require 'spec/rails' | |
Spec::Runner.configure do |config| | |
# If you're not using ActiveRecord you should remove these | |
# lines, delete config/database.yml and disable :active_record |
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
## main file | |
<div id="eula_table_id"> | |
<%= render :partial => "config/eula_list" %> | |
</div> | |
<div class="form-row"> | |
<%= link_to_remote "Add new end user license agreement", | |
{ :update => "eula_table_id", # you may not need this :update parameter | |
:before => "$('#add-user-spinner').show();" + |
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 IO | |
def encrypted_read(filename) | |
puts filename | |
end | |
alias_method :non_encrypted_read, :read | |
alias_method :read, :encrypted_read | |
end | |
#>> IO.read('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
require 'openssl' | |
require 'digest/sha1' | |
class Test | |
def self.decrypt(content, password) | |
cipher = OpenSSL::Cipher::Cipher.new("aes-256-cbc") | |
cipher.decrypt | |
cipher.key = Digest::SHA1.hexdigest(password) | |
cipher.update(content) | |
cipher.final |
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
[MacBook] [2009-06-18 13:24:10] [14502] [FATAL] /!\ FAILSAFE /!\ 18/06/2009 | |
Status: 500 Internal Server Error | |
Expected /Users/andy/Sites/fdj-production/app/helpers/cms/component_helper.rb to define Cms::ComponentHelper | |
/Users/andy/Sites/fdj-production/vendor/rails/activesupport/lib/active_support/dependencies.rb:426:in `load_missing_constant' | |
/Users/andy/Sites/fdj-production/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing' | |
/Users/andy/Sites/fdj-production/vendor/rails/activesupport/lib/active_support/inflector.rb:361:in `constantize' | |
/Users/andy/Sites/fdj-production/vendor/rails/activesupport/lib/active_support/inflector.rb:360:in `each' | |
/Users/andy/Sites/fdj-production/vendor/rails/activesupport/lib/active_support/inflector.rb:360:in `constantize' | |
/Users/andy/Sites/fdj-production/vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:162:in `constantize' | |
/Users/andy/Sites/fdj-production/vendor/rails/actionpack/lib/actio |
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 Vehicle | |
cattr_accessor :name | |
end | |
class Car < Vehicle | |
end | |
Car.name = "John" | |
#=> "John" |
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 'rubygems' | |
require 'builder' | |
favorites = { | |
'candy' => 'Neccos', 'novel' => 'Empire of the Sun', 'holiday' => 'Easter' | |
} | |
xml = Builder::XmlMarkup.new(:indent => 2 ) do |b| | |
b.instruct! :xml, :version => "1.1", :encoding => "UTF-8" |
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
$ gem list --local|grep 'LVS-JSONService' | |
LVS-JSONService (0.2.5, 0.2.4, 0.2.3, 0.2.2, 0.2.1) | |
$ irb | |
>> require 'rubygems' | |
=> false | |
>> require 'nokogiri' | |
=> true | |
# Just checking gems load OK | |
>> require 'jsonservice' |
OlderNewer