Skip to content

Instantly share code, notes, and snippets.

View andyjeffries's full-sized avatar

Andy Jeffries andyjeffries

View GitHub Profile
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 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
## 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();" +
class IO
def encrypted_read(filename)
puts filename
end
alias_method :non_encrypted_read, :read
alias_method :read, :encrypted_read
end
#>> IO.read('a')
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
[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
class Vehicle
cattr_accessor :name
end
class Car < Vehicle
end
Car.name = "John"
#=> "John"
module ActionController #:nodoc:
module Cookies
def cookies
@cookies ||= CookieJar.new(self)
end
end
end
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"
$ 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'