Skip to content

Instantly share code, notes, and snippets.

https://gist.github.com/guyboertje/9f092038311c4777f453
@guyboertje
guyboertje / gist:3788293
Created September 26, 2012 14:13
virtus hacks console output
h = {description: 'blah', id: '1046d670-e9ff-012f-5d84-38f6b11b6fe1', images: [1,2,3], name: 'bob', owner_id: '1005bc90-e9ff-012f-5d84-38f6b11b6fe1', creating_user_id: '1005bb10-e9ff-012f-5d84-38f6b11b6fe1', summary: 'aasdasd', tags: [1,2,3], upc: 333222}
=> {:description=>"blah", :id=>"1046d670-e9ff-012f-5d84-38f6b11b6fe1", :images=>[1, 2, 3], :name=>"bob", :owner_id=>"1005bc90-e9ff-012f-5d84-38f6b11b6fe1", :creating_user_id=>"1005bb10-e9ff-012f-5d84-38f6b11b6fe1", :summary=>"aasdasd", :tags=>[1, 2, 3], :upc=>333222}
1.9.3p194 :002 > h[:digital_commodities] = [{asset_id: '1046e450-e9ff-012f-5d84-38f6b11b6fe1', commodity_id: '10552d90-e9ff-012f-5d84-38f6b11b6fe1', from_warehouse: false, meta_data_changed: false, meta_data: {}, tags: []}]
=> [{:asset_id=>"1046e450-e9ff-012f-5d84-38f6b11b6fe1", :commodity_id=>"10552d90-e9ff-012f-5d84-38f6b11b6fe1", :from_warehouse=>false, :meta_data_changed=>false, :meta_data=>{}, :tags=>[]}]
1.9.3p194 :003 > h[:public_copy_missing] = [1,2,3,4]
@guyboertje
guyboertje / Entity_sales_doc.txt
Created April 17, 2012 13:51
Entity related Sales
Regards the building of collections of documents for entity reporting.
Prerequisites:
Import of entities
Import of products
Import of users
Actions:
Import of historic sales
Import of joining/leaving mailinglists
var WeightedMarkerClusters;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
(function($, w) {}, WeightedMarkerClusters = (function() {
function WeightedMarkerClusters(jq_element, options) {
this.ele = jq_element;
this.opts = options;
this.markerCluster = null;
this.entity_id = this.ele.parent().find(".context").eq(0).data("entityId");
this.map = this.ele.find(this.opts.map_selector).eq(0);
this.map.gmap3({
@guyboertje
guyboertje / dci-builder.rb
Created March 2, 2012 19:51
DCI: Builder approach
module RoleExtender
def new properties = {}
include_roles nil, properties
end
private
def include_roles roles, properties
instance = allocate()