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 'json' | |
require 'csv' | |
raise Exception, 'you must provide a json file' unless ARGV[0] | |
json = JSON.parse(File.open(ARGV[0]).read) | |
CSV.open(ARGV[0].split(".").first+".csv", "w") do |csv| | |
csv << json.first.collect {|k,v| k} |
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
//product by category controller | |
// dentro do init | |
this.options = { | |
placeholder: "Select segments...", | |
dataTextField: "name", | |
dataValueField: "id", | |
valuePrimitive: true, | |
autoBind: false, | |
dataSource: { |
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
this.checkProcessOnGoing = setInterval(function() { | |
if($state.current.name==='main.import_test_data') { | |
Snapshot.checkHasProcessOngoing(project_id).then(function (response) { | |
self.onGoingProcess = response.data; | |
if (self.onGoingProcess != undefined) { | |
self.progressBar = self.onGoingProcess.progress; | |
if (self.onGoingProcess.error) { | |
alerts.add('danger', 'Problem Importing', self.onGoingProcess.error); | |
Snapshot.deleteCheckProcessWithError(project_id); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("#date").blur(function(){ | |
var dateReg = /^\d{2}[/]\d{2}[/]\d{4}$/; | |
var day = parseInt($(this).val().split('/')[0]); | |
var mounth = parseInt($(this).val().split('/')[1]); |
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
<!DOCTYPE html> | |
<!-- TE AMOOOOOOOOOOO --> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
function validaEmail(obj) { | |
var valor = obj; | |
console.log(valor.value) |
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
def push_data | |
crawler_id= DataUpdateStat.last.id | |
r = params[:webservice] | |
scobject = SiteCategory.find_by_listing_url(r[:sc]) | |
scsite = scobject.site |
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
def migrate_all | |
WorkitCrawler.puts_action("======= Start migrate_all #{Time.now}") | |
data_update_stat = DataUpdateStat.last.id | |
DataUpdateStat.execute_procedure :WorkIT_to_OLP, data_update_stat, 'param2' |
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
INSERT INTO [ForceIndiaCurrentRun].[dbo].[workit_product_prices] | |
([workit_bpl_list_id] | |
,[base_product_id] | |
,[category_id] | |
,[icrt_code] | |
,[site_id] | |
,[site_name] | |
,[url] | |
,[brand] | |
,[title] |
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
INSERT INTO [ForceIndiaCurrentRun].[dbo].[workit_product_prices] | |
([workit_bpl_list_id] | |
,[base_product_id] | |
,[category_id] | |
,[icrt_code] | |
,[site_id] | |
,[site_name] | |
,[url] | |
,[brand] | |
,[title] |
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
def save_file(file_path) | |
WorkitCrawler.puts_action("saving: #{File.basename(file_path)}") | |
file = File.open(file_path) | |
doc = Nokogiri::XML(file) | |
workit_product_prices_array = [] | |
workit_product_price_attributes = [] | |
workit_product_price_attributes_catalog = [] | |
quantity_to_be_process = 0 | |
doc.xpath('//CATALOGPRODUCT').each_with_index do |catalog_product_node,indice| |