Skip to content

Instantly share code, notes, and snippets.

View banderson6979's full-sized avatar

Bryan Anderson banderson6979

  • MOBI Wireless Management
  • Anderson, Indiana
View GitHub Profile
@banderson6979
banderson6979 / customer.rake
Created October 11, 2018 20:13
create customer from yaml
customer_data = begin
YAML::load(File.open('lib/tasks/data/simplicitus_customer.yml'))
rescue => exception
puts "Could not parse YAML: #{e.message}"
end
customer_data.each do |key, value|
Customer.create!()
end
@banderson6979
banderson6979 / Customer Yaml
Created October 9, 2018 19:24
Create customer from Yaml
customer:
id: 1337
customerName: Simplicitus, Corp
createBy: 1
addr1: 190 Peach Ave
addr:
city: Hershey
st: PA
zip: 17033
zip4:
@banderson6979
banderson6979 / snippets.cson
Created March 15, 2018 03:15 — forked from 18thAvenue/snippets.cson
CFWheels Atom editor cfscript snippets
# CFW-Atom-Snippets - Craig Kauppila
#Cfwheels Snippets for Atom Editor
#I love Atom editor and thought it would be nice to have snippets for CFwheels while writing in script.
#My setup:
#Install language-cfml package
#Install Atom-Beautify package
#Go to File > Snippets > Paste all or just a few of the snippets into your snippets.cson file.
@banderson6979
banderson6979 / gist:d3747a89046d78d68ded201661243ada
Created October 10, 2017 18:39
CFML: Importing data from a spreadsheet to a database table
<!--- read the spreadsheet data into a query object --->
<cfspreadsheet action="read" src="#ExpandPath( './data.xlsx' )#" query="importdata" headerrow="1" />
<!--- create a variable to store the codes of products that could not be imported --->
<cfset failedimports = "" />
<!--- loop through the query starting with the first row containing data (row 2) --->
<cfloop query="importdata" startrow="2">
<!--- check row contains valid data (all fields must contain a value and price must be numeric) --->
<cfif !Len( product_title ) || !Len( product_code ) || !IsNumeric( product_price )>