Skip to content

Instantly share code, notes, and snippets.

View danielfone's full-sized avatar

Daniel Fone danielfone

View GitHub Profile
diff --git a/ars.c b/ars.c
index 7c9ed45..97ad68f 100644
--- a/ars.c
+++ b/ars.c
@@ -830,7 +830,7 @@ int ars_bsd_fix(struct ars_packet *pkt, unsigned char *packet, size_t size)
return -ARS_INVALID;
}
ip = (struct ars_iphdr*) packet;
-#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI
+#if defined OSTYPE_DARWIN || defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI
diff --git a/Makefile.in b/Makefile.in
index a72841e..5b3c50f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -15,6 +15,7 @@ DEBUG= -g
#(not raccomanded)
COMPILE_TIME= @FORCE_LIBPCAP@
INSTALL_MANPATH=@MANPATH@
+INSTALL_PATH=
@PCAP@
@danielfone
danielfone / io.rb
Created August 16, 2011 19:13
homebrew io.rb - snow leopard
require 'formula'
class Io < Formula
head 'https://github.com/stevedekorte/io.git', :tag => 'e3908ce802a5d4fb56713610f5e1d62d6bf1f011'
homepage 'http://iolanguage.com/'
depends_on 'cmake' => :build
depends_on 'libsgml'
depends_on 'ossp-uuid'
@danielfone
danielfone / pxpost-multi-store-refunds.diff
Created November 14, 2011 02:34
multi-store refund support
diff --git a/app/code/community/MageBase/DpsPaymentExpress/Model/Method/Pxpost.php b/app/code/community/MageBase/DpsPaymentExpress/Model/Method/Pxpost.php
index 96dde32..5b30bab 100644
--- a/app/code/community/MageBase/DpsPaymentExpress/Model/Method/Pxpost.php
+++ b/app/code/community/MageBase/DpsPaymentExpress/Model/Method/Pxpost.php
@@ -48,6 +48,28 @@ class MageBase_DpsPaymentExpress_Model_Method_Pxpost extends Mage_Payment_Model_
protected $_canSaveCc = false;
protected $_order;
+ protected $_store;
+
@danielfone
danielfone / gist:4248034
Created December 10, 2012 02:28
time bundle exec rake environment
~/Sites/shipping.etailer(ecl-logic) $ rvm current
ruby-1.9.2-p320
~/Sites/shipping.etailer(ecl-logic) $ time bundle exec rake environment
Connecting to database specified by database.yml
real 0m13.978s
user 0m9.382s
sys 0m1.696s
~/Sites/shipping.etailer(ecl-logic) $ time bundle exec rake environment
Connecting to database specified by database.yml
@danielfone
danielfone / event_types_request.xml
Last active December 14, 2015 04:09
ECL Online missing pricing data
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecl="http://ECL.Online.BT.ChangeLog.ChangeLogRequest_v1_0_XML.xsd" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<ecl:ChangeLogRequest>
<ecl:MessageDateTime>2013-02-25T10:18:37+13:00</ecl:MessageDateTime>
<ecl:BusinessUnit>CP</ecl:BusinessUnit>
<ecl:AccountNumber>91327067</ecl:AccountNumber>
<ecl:ReturnData>EventTypes</ecl:ReturnData>
</ecl:ChangeLogRequest>
</soap:Body>
# returns [output string, err string, exit code]
def cmd(args, input = nil)
parent_read, child_write = IO.pipe
err_read, err_write = IO.pipe
child_read, parent_write = IO.pipe if input
pid = fork do
if input
parent_write.close
$stdin.reopen(child_read)
@danielfone
danielfone / gist:5654600
Created May 27, 2013 00:41
Classes descending from StandardError in an unaltered Rails 3.2.13 application.
StandardError
SQLite3::Exception
SQLite3::MemoryException
SQLite3::LockedException
SQLite3::BusyException
SQLite3::AbortException
SQLite3::PermissionException
SQLite3::InternalException
SQLite3::SQLException
SQLite3::NotADatabaseException
@danielfone
danielfone / class_hierarchy.rb
Created May 27, 2013 00:58
Ruby class to build and print a class hierarchy.
class ClassHierarchy
def initialize(root_class)
@root_class = root_class
@parent_class = @root_class.superclass
@tree = {}
generate_tree
end
def to_s
MyExceptions = [RangeError, RegexpError, IOError].freeze
begin
raise IOError, "should be rescued"
rescue *MyExceptions => e
puts e
end