Skip to content

Instantly share code, notes, and snippets.

View KB1RMA's full-sized avatar

Christopher Snyder KB1RMA

  • Liberty Mutual
  • Newburyport, MA
  • X @kb1rma
View GitHub Profile
<?php
public function subscribeEvents() {
Backend::$events->addEvent('shop:onExtendProductModel', $this, 'extend_product_model');
Backend::$events->addEvent('shop:onExtendProductForm', $this, 'extend_product_form');
Backend::$events->addEvent('shop:onOverrideProductCsvExportColumns', $this, 'set_product_csv_export_columns');
Backend::$events->addEvent('shop:onOverrideProductCsvImportData', $this, 'set_product_csv_import_data');
}
@KB1RMA
KB1RMA / canada.rb
Last active December 14, 2015 10:49
#!/usr/bin/env ruby
# ./canada.rb amateur.txt
Fields = %w{call first_name last_name address city postal_code license}
puts Fields.join ','
open(ARGV[0],:encoding=>"ISO8859-1").each_line.map{|l|
p = (case l.size
when 212 then
l.match /^(?<call>.{7})(?<first_name>.{36})(?<last_name>.{36})(?<address>.{71})(?<city>.{36})(?<postal_code>.{14})(?<license>.{10})/
when 471 then