Skip to content

Instantly share code, notes, and snippets.

@dsadaka
dsadaka / migration_output.txt
Created November 29, 2020 22:50
Output from Spree 3.1 migrations
Warning: This migration changes the meaning of 'deleted'. Before this change, 'deleted' meant products that were no longer being sold in your store. After this change, you can only delete a product or variant if it has not already been sold to a customer (a model-level check enforces this). Instead, you should use the new field 'discontinue_on' for products or variants which were sold in the past but no longer for sale. This fixes bugs when other objects are attached to deleted products and variants. (Even though acts_as_paranoid gem keeps the records in the database, most associations are automatically scoped to exclude the deleted records.) In thew meaning of 'deleted,' you can still use the delete function on products & variants which are *truly user-error mistakes*, specifically before an order has been placed or the items have gone on sale. You also must use the soft-delete function (which still works after this change) to clean up slug (product) and SKU (variant) duplicates. Otherwise, you should genera
DAN SADAKA
801 NE 167 St, STE 310 ▪ North Miami Beach, FL 33162
(305) 999-0191 office ▪ (305) 491-1553 cell
dan@web-site1.com
SR. RUBY ON RAILS DEVELOPER/TEAM LEAD
Decades of experience in software development, with current focus mainly on React on Rails systems in the AWS cloud. Integrating in-house ERP systems: a long history of implementing High End accounting and distribution systems gives me a unique edge here. Setting up backend infrastructures and automated deployments is also something I enjoy.
TECHNICAL SKILLS:
 Ruby on Rails Expert
@dsadaka
dsadaka / Gemfile
Last active June 1, 2019 18:18
Theorem Flatten Exercise
source "https://rubygems.org"
gem "rspec"
@dsadaka
dsadaka / \lib\systemd\system\sidekiq-static.service
Last active June 21, 2019 19:20
systemd unit files for sidekiq service. note backslashes in filenames are really front slashes.
# This file actually fires up multiple sidekiq services.
# to start: systemctl start sidekiq.target
#
[Unit]
Description=Fire up up to 6 sidekiqs
# If you want more than 6 processes, append sidekiq@7.service, sidekiq@8.service, etc. to the ExecStart line below
# Note that only as many as have been enabled will actually start.
# Note also that the Unit data for each sidekiq process is in /lib/systemd/system/sidekiq@.service
[Service]
@dsadaka
dsadaka / gist:5874220
Created June 27, 2013 05:42
Too many db calls
INFO 01:39:27 ubuntu rails[4512]: Started GET "/po_hdrs" for 127.0.0.1 at 2013-06-27 01:39:27 -0400
INFO 01:39:27 ubuntu controllers[4512]: Processing by PoHdrsController#index as HTML
DEBUG 01:39:27 ubuntu models[4512]: User Load (90.2ms) EXEC sp_executesql N'SELECT TOP (1) [users].* FROM [users] WHERE [users].[id] = 6'
DEBUG 01:39:27 ubuntu models[4512]: Role Load (82.9ms) EXEC sp_executesql N'SELECT TOP (1) [roles].* FROM [roles] INNER JOIN [user_roles] ON [roles].[id] = [user_roles].[role_id] WHERE [user_roles].[user_id] = 6'
DEBUG 01:39:32 ubuntu models[4512]: SQL (5679.3ms) EXEC sp_executesql N'SELECT [dbo].[POHDRF00].[po_no] AS t0_r0, [dbo].[POHDRF00].[batch_no] AS t0_r1, [dbo].[POHDRF00].[usr_id] AS t0_r2, [dbo].[POHDRF00].[vend_no] AS t0_r3, [dbo].[POHDRF00].[alt_po_no] AS t0_r4, [dbo].[POHDRF00].[po_hdr_dat] AS t0_r5, [dbo].[POHDRF00].[alt_po_no_2] AS t0_r6, [dbo].[POHDRF00].[vend_nam] AS t0_r7, [dbo].[POHDRF00].[vend_loc_cod] AS t0_r8, [dbo].[POHDRF00].[vend_addr_1] AS t0_r9, [dbo].[POHD
@dsadaka
dsadaka / gist:5864991
Created June 26, 2013 05:30
Errors when trying to "Approve All"
INFO 01:26:06 ubuntu rails[8959]: Started PUT "/po_hdrs/000000000022151" for 127.0.0.1 at 2013-06-26 01:26:06 -0400
INFO 01:26:06 ubuntu controllers[8959]: Processing by PoHdrsController#update as JSON
INFO 01:26:06 ubuntu controllers[8959]: Parameters: {"utf8"=>"✓", "authenticity_token"=>"oyX4cWhEcmUGc8oChYViZ8MqjHp3bfuwxxSjsv3Lr9c=", "po_hdr"=>{"approved"=>"1"}, "id"=>"000000000022151"}
DEBUG 01:26:06 ubuntu models[8959]: User Load (91.5ms) EXEC sp_executesql N'SELECT TOP (1) [users].* FROM [users] WHERE [users].[id] = 6'
DEBUG 01:26:06 ubuntu models[8959]: Role Load (87.6ms) EXEC sp_executesql N'SELECT TOP (1) [roles].* FROM [roles] INNER JOIN [user_roles] ON [roles].[id] = [user_roles].[role_id] WHERE [user_roles].[user_id] = 6'
DEBUG 01:26:06 ubuntu models[8959]: PoHdr Load (89.5ms) EXEC sp_executesql N'SELECT TOP (1) [dbo].[POHDRF00].po_no FROM [dbo].[POHDRF00] LEFT OUTER JOIN [dbo].[POLINF00] ON [dbo].[POLINF00].[po_no] = [dbo].[POHDRF00].[po_no] WHERE [dbo].[POHDRF00].[po_no] = @0 GROUP
@dsadaka
dsadaka / gist:5864986
Created June 26, 2013 05:28
Deprecation errors displaying po_hdrs#index
INFO 01:22:56 ubuntu controllers[8959]: Processing by PoHdrsController#index as HTML
DEBUG 01:22:57 ubuntu models[8959]: User Load (91.6ms) EXEC sp_executesql N'SELECT TOP (1) [users].* FROM [users] WHERE [users].[id] = 6'
DEBUG 01:22:58 ubuntu models[8959]: Role Load (88.4ms) EXEC sp_executesql N'SELECT TOP (1) [roles].* FROM [roles] INNER JOIN [user_roles] ON [roles].[id] = [user_roles].[role_id] WHERE [user_roles].[user_id] = 6'
DEBUG 01:23:07 ubuntu models[8959]: SQL (7141.3ms) EXEC sp_executesql N'SELECT [dbo].[POHDRF00].[po_no] AS t0_r0, [dbo].[POHDRF00].[batch_no] AS t0_r1, [dbo].[POHDRF00].[usr_id] AS t0_r2, [dbo].[POHDRF00].[vend_no] AS t0_r3, [dbo].[POHDRF00].[alt_po_no] AS t0_r4, [dbo].[POHDRF00].[po_hdr_dat] AS t0_r5, [dbo].[POHDRF00].[alt_po_no_2] AS t0_r6, [dbo].[POHDRF00].[vend_nam] AS t0_r7, [dbo].[POHDRF00].[vend_loc_cod] AS t0_r8, [dbo].[POHDRF00].[vend_addr_1] AS t0_r9, [dbo].[POHDRF00].[vend_addr_2] AS t0_r10, [dbo].[POHDRF00].[vend_addr_3] AS t0_r11, [dbo].[POHDRF00].[vend_cntry
@dsadaka
dsadaka / share-facebook-wall.js
Created November 1, 2011 01:44
JS with getJSON to build select tag of albums
// Modal Behaviors:
$('.share-facebook-wall').fancybox($.extend({}, modal_lightbox, {
onComplete : function() {
var $target_div = $('#copy-to-album');
$target_div.find('a').click(function() {
$(this).text('Loading Albums...').addClass('button-disabled').prev().remove();
$.getJSON("/partner_album_list.json", {site : "Facebook"},
function(data) {
var html = '<select name="' + 'target_album' + '" id="' + 'target_album' + '">';
html += '<option value="">(Select Existing or Create New)</option>';