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
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
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
<?php | |
/** | |
* @see Mage_Customer_Block_Widget_Dob | |
*/ | |
?> | |
<label class="dob-label" for="<?php echo $this->getFieldId('month')?>"<?php if ($this->isRequired()) { echo ' class="required"'; } ?>><?php echo $this->__('Birthday') ?></label> | |
<div class="customer-dob input-box"> | |
<div class="dob-year"> | |
<?php $currentYear = intval(date("Y")); ?> | |
<select name="<?php echo $this->getFieldName('year'); ?>" id="<?php echo $this->getFieldId('year'); ?>"> |
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
Coding Standards | |
++++++++++++++++ | |
https://golang.org/doc/effective_go.html | |
Go In General | |
+++++++++++++ | |
https://gobyexample.com/ | |
https://golang.org/doc/code.html | |
http://www.go-gazelle.com |
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
package main | |
import ( | |
"flag" | |
"os" | |
"github.com/dele454/medium/csv-transform-to-html/cmd" | |
"github.com/dele454/medium/csv-transform-to-html/internal/errs" | |
) |
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
package cmd | |
import ( | |
"sync" | |
"github.com/dele454/medium/csv-transform-to-html/internal/parser" | |
"github.com/dele454/medium/csv-transform-to-html/internal/report" | |
"github.com/dele454/medium/csv-transform-to-html/internal/transform" | |
) |
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
// WriteReportToStdOut writes report to stdout | |
func (t *TransformationReporter) WriteReportToStdOut(ctx context.Context) error { | |
var err error | |
path := utils.RootDir() | |
// create template | |
tmpl, err := template.Must(template.New("STDOUT"), err). | |
ParseFiles(path + "/internal/transform/template/report.tmpl") | |
if err != nil { |
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
// Read reads from the csv file | |
func (c *CSVParser) Read(wg *sync.WaitGroup, record chan<- []string, done chan<- bool) { | |
start := time.Now() | |
defer func() { | |
close(done) | |
close(record) | |
c.reporter.AddDuration(time.Since(start).Seconds()) | |
wg.Done() |
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
// ProcessRecord process records received via the chan | |
func (tr *HTMLTransformer) ProcessRecord(wg *sync.WaitGroup, record <-chan []string, done <-chan bool) { | |
var ( | |
now = time.Now() | |
data []utils.SalesRecord | |
end bool | |
ctx = context.Background() | |
) | |
defer func() { |
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 lang="en"> | |
<head> | |
<title>{{.FileName}}</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"> | |
</head> | |
<body class=""> | |
<div class="container-fluid"> | |
<h1>{{.FileName}}</h1> | |
<table class="table table-striped"> |
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
package cmd | |
import ( | |
"context" | |
"encoding/csv" | |
"io" | |
"os" | |
"sync" | |
"time" | |
) |
OlderNewer