Skip to content

Instantly share code, notes, and snippets.

View raldred's full-sized avatar

Rob Aldred raldred

View GitHub Profile
package AuthControl::auth_control;
#use FindBin;
#use lib $FindBin::Bin . '/../../../cgi-bin';
use Data::Dumper;
use strict;
use Digest::MD5 qw(md5 md5_hex md5_base64);
# ::logGlobal("Loaded AuthControl Library");
def update_attributes_with_seed_products(params)
return false if params.empty?
if params[:seed_all_products] || params[:seed_selected_products]
return seed_products(params)
end
update_attributes_without_seed_products(params)
end
def update_with_params(params)
return false if params.empty?
response = {
:avs_result => {
:street_match' => 'Y',
:postal_match' => 'Y'
},
:cvv_result => 'Y'
}
class MyJob < ActiveRecord::Base
def bulk_task
start()
task_work()
@log.info("Errors missing: #{errors.inspect}")
finish()
end
private
require 'spec/expectations'
require 'rack/test'
require 'webrat'
require 'ruby-debug'
Webrat.configure do |config|
config.mode = :selenium
#optional:
config.application_port = 4555 # defaults to 3001. Avoid Selenium's default port, 4444
config.application_framework = :sinatra # could also be :merb. Defaults to :rails
@raldred
raldred / vhost.conf
Created December 18, 2009 17:19
apache config for passenger multiple vhosts using same source
NameVirtualHost 127.0.0.1:80
NameVirtualHost 10.0.0.1:80
<VirtualHost 127.0.0.1:80>
DocumentRoot /Users/robaldred/Sites/app/public
RewriteEngine On
ServerName app
RailsEnv development
</VirtualHost>
→ rake hydra:spec --trace
(in /Users/robaldred/Sites/ahoys)
loading bundler gems
** Invoke hydra:spec (first_time)
** Invoke env:test (first_time)
** Execute env:test
** Execute hydra:spec
Hydra Testing [> ] 0/1Booting rail env test
Done booting rails env
Starting Sunspot Server
robaldred 6643 69.0 0.4 2450232 17392 s012 R+ 2:13pm 0:00.34 /Users/robaldred/.rvm/rubies/ruby-1.8.7-p174/bin/ruby -e 42
robaldred 6642 20.6 0.4 2450264 17784 s012 S+ 2:13pm 0:00.41 /Users/robaldred/.rvm/rubies/ruby-1.8.7-p174/bin/ruby -e 42
robaldred 6641 4.5 0.4 2450264 17784 s012 S+ 2:13pm 0:00.42 /Users/robaldred/.rvm/rubies/ruby-1.8.7-p174/bin/ruby -e 42
robaldred 6640 0.9 0.4 2450264 17784 s012 S+ 2:13pm 0:00.41 /Users/robaldred/.rvm/rubies/ruby-1.8.7-p174/bin/ruby -e 42
robaldred 6639 0.1 0.4 2450264 17784 s012 S+ 2:13pm 0:00.42 /Users/robaldred/.rvm/rubies/ruby-1.8.7-p174/bin/ruby -e 42
robaldred 6617 0.0 0.4 2450264 17784 s012 S+ 2:13pm 0:00.42 /Users/robaldred/.rvm/rubies/ruby-1.8.7-p174/bin/ruby -e 42
robaldred 6614 0.0 0.4 2450264 17784 s012 S+ 2:13pm 0:00.41 /Users/robaldred/.rvm/rubies/ruby-1.8.7-p174/bin/ruby -e 42
robaldred 6609 0.0 0.4 2450264 17784 s012 S+ 2:13pm 0:00.43 /Users/robaldred/.rvm/rubies
-- ssh-to-test-slaves.applescript
--
-- Created by Rob Aldred on 2010-05-21.
-- Copyright (c) 2010 . All rights reserved.
--
-- Usage:
-- osascript -ss ssh-to-slaves.applescript
on run
@raldred
raldred / gist:616615
Created October 8, 2010 10:43
arduino_hudson_status
#include <Ethernet.h>
#include <WString.h>
int red = 6;
int yellow = 7;
int green = 8;
byte mac[] = { 0x00, 0x0C, 0x29, 0x8F, 0xA9, 0xE5 };
byte ip[] = { 192,168,3,244 };
byte gateway[] = { 192,168,3,1 };