Skip to content

Instantly share code, notes, and snippets.

@qcom
qcom / spects.txt
Last active December 15, 2015 15:59
Specs
My project is the development of a sort of support ticket system. So when an employee has a problem that needs action from another department or employee, a ticket is issued to the appropriate target.
The following is a quick overview of the entities that I'm having trouble modeling.
1. Tickets
Tickets are issues that need to be resolved, such as "Remove product X from our storefronts because it has been discontinued by the vendor." Tickets are constructed from one of a certain number of predefined "types" (can be thought of as "templates"). So, our above ticket example would have been created from the "Remove discontinued product" type. Another type might be "Increase sales price of product X", and so on. Basically, these types amount to just a collection of fields that need to be filled out by the instances of the templates. Tickets are composed of one or more tasks, as explained below. The tasks generated for each ticket depends on the kind of ticket it derives from.
2. Tasks
These are specific actions
@qcom
qcom / Exporter.cs
Last active December 17, 2015 05:19
class Program
{
static string connString = "Data Source=ZACH7-PC;Initial Catalog=Products;Integrated Security=True";
static string query = String.Empty;
static string header = "TemplateType=HomeImprovement Version=2012.0913 This row for Amazon.com use only. Do not modify or delete. Offer Information - These attributes are required to make your item buyable for customers on the site ";
static string schema = "sku,standard-product-id,product-id-type,product-name,brand,manufacturer,manufacturer-part-number,merchant-catalog-number,bullet-point1,bullet-point2,bullet-point3,bullet-point4,bullet-point5,description,product_type,item-price,currency,condition-type,condition-note,quantity,msrp,map,launch-date,release-date,leadtime-to-ship,restock-date,max-aggregate-ship-quantity,product-tax-code,warranty-type,seller-warranty-description,prop-65,cpsia-warning1,cpsia-warning2,cpsia-warning3,cpsia-warning4,cpsia-warning-description,sale-price,sale-start-date,sale-end-date,item-type,used-
@qcom
qcom / output.txt
Created May 10, 2013 20:47
Output of Exporter.cs
1750-000-110 1700 Series Long Cases Pelican Pelican 1750-000-110 Watertight, crushproof and dustproof cases feature open-cell core, solid wall construction, O-ring seal and stainless steel hardware and padlock protectors. Automatic pressure equalization valve, polyurethane wheels with stainless steel bearings and fold-down handles unless otherwise specified. Lifetime guarantee of excellence. Black. Some cases are also available for personalized nameplate service. Call for details.
1700 Long case is a 3-piece foam set with interior dimensions: 35.75" x 13.50" x 5.25".
1720 Long case is a 3-piece foam set with interior dimensions: 42.00" x 13.50" x 5.25".
1750 Long case is a 3-piece foam set with interior dimensions: 50.50" x 13.50" x 5.25".
1770 Long case is a 4-piece foam set with (4) extra-deep, base-to-lid locking cleats for maximum stacking stability, (2) integrated automatic pressure equalization valves, (2) double-wide handles and (6) easy-open double throw latches. Interior dimensions: 54.58" x
var casper = require('casper').create({
clientScripts: ['includes/jquery-2.0.1.min.js'],
logLevel: 'debug',
verbose: true
});
var noop = function() {};
var index = 'http://www.orsnasco.com/storefrontB2BWEB/';
var manIndex = 'http://www.orsnasco.com/storefrontB2BWEB/customauth/manIndex.jsp';
@qcom
qcom / test.js
Last active December 18, 2015 03:59
var casper = require('casper').create();
casper.start();
casper.then(function() {
casper.open('http://localhost:3000/test', {
method: 'post',
data: { foo: 'bar' }
});
});
@qcom
qcom / foo.js
Last active December 18, 2015 05:09
function foo() {
var things;
casper.thenOpen(url, function() {
things = casper.evaluate(function() {
var things = [];
$('.alphabody a').each(function() {
things.push($(this).text());
});
return things;
});
function isObject(o) {
return o instanceof Object && o.constructor === Object;
}
function getNumberLeft (man) {
var sum = 0;
var keys = Object.keys(man.products);
keys.forEach(function(key) {
var keys2 = Object.keys(man.products[key].products);
keys2.forEach(function(key2, i) {
@qcom
qcom / sample.json
Last active December 19, 2015 00:29
{ "manID":"842",
"manName":"3M",
"name":"3M",
"url":"http://www.orsnasco.com/storefrontB2BWEB/customauth/processSetMan.jsp?manId=842&manname=3M",
"products": {
"Welding Supplies": {
"name":"Welding Supplies",
"url":"http://www.orsnasco.com/storefrontB2BWEB/customauth/prodCategory.jsp?catId=265&catname=Welding+Supplies",
"products": {
"Welding Supplies Other": {
var casper = require('./util/augment/extend')(require('casper').create({}));
var fs = require('fs');
var check = require('./util/check');
var sumIn = require('../mans/util/sumIn');
casper.start();
var n = 0;
var mans;
var fs = require('fs');
var casper = require('./util/augment/extend')(require('./util/augment/config')(require('casper').create({
clientScripts: ['includes/jquery-2.0.1.min.js'],
pageSettings: {
loadPlugins: false
}
})));
var mans = require('./mans');
var keys = Object.keys(mans);