This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FacebookDataFeedController < ApplicationController | |
def export | |
@products = Spree::Product.available | |
respond_to do |format| | |
format.csv { send_data @products.to_fb_csv, filename: "facebook-data-feed.csv" } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Removing Clothes from the top for now, might want to bring it back at a later time | |
# - name: "Clothes" | |
# position: 0 | |
# subcategories: | |
categories: | |
- name: "Women" | |
position: 0 | |
subcategories: | |
- name: "Bottoms" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Analytics | |
class KeenEventJob < ::ActiveJob::Base | |
queue_as :analytics | |
def perform event, data | |
::Keen.publish event.to_sym, data | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 14Xd2BHKPndGCdEbAKmtJHE3sAkzW37XcH https://explorer.blockstack.org/address/14Xd2BHKPndGCdEbAKmtJHE3sAkzW37XcH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that "ychaker.id" is my Blockstack ID. https://onename.com/ychaker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#alerts').html('<%= j render partial: "shared/alerts" %>'); | |
$('input[type="file"]').val(''); | |
$('input[name="doc[file]"]').val(''); | |
var modal; | |
<% if @operation.valid? %> | |
modal = $('#upload-modal-<%= @model.doc_task.id %>'); | |
modal.modal('hide'); | |
modal.on('hidden.bs.modal', function() { | |
$('#tasks').html('<%= j render partial: "doc_tasks/list", locals: { pending_tasks: @pending_tasks, completed_tasks: @completed_tasks } %>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'representable/json' | |
class Doc::Create < Trailblazer::Operation | |
include Model | |
include Responder | |
include Representer | |
include Representer::Deserializer::Hash | |
include Dispatch | |
model Doc, :create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DocsController < ApplicationController | |
respond_to :json, :js | |
before_action :get_doc, only: [ :show, :reload_doc ] | |
def create | |
create_params = doc_params.to_h.merge!(current_user: current_user) | |
result, op = Doc::Create.run(create_params) | |
@operation = op |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready -> | |
Dropzone.autoDiscover = false | |
$(document).on 'shown.bs.modal', '.upload-modal', -> | |
modal = this | |
previewTemplate = $('#' + modal.id + ' .dz-file-preview')[0].innerHTML | |
# Make sure to only initialize the dropzone once. | |
if ( $('#' + modal.id + ' .dropzone:not(.dz-attached)').length ) | |
dropzone = new Dropzone('#' + modal.id + ' .dropzone', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Upload Doc Modal --> | |
<div | |
class="modal fade upload-modal" | |
id="upload-modal-<%= task.id %>" | |
tabindex="-1" | |
role="dialog" | |
aria-labelledby="upload-modal-<%= task.id %>" | |
> | |
<div class="modal-dialog" role="document"> | |
<div class="modal-content"> |
NewerOlder