Skip to content

Instantly share code, notes, and snippets.

@hectorgool
hectorgool / webpack.config.js
Last active June 30, 2018 00:38
webpack template production and develop
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
module.exports = (env) => {
const plugins = [
new ExtractTextPlugin("css/[name].[hash].css")
]
@hectorgool
hectorgool / index.html
Last active May 24, 2018 16:51
production
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Platzi Video</title>
</head>
<body>
<div id="app"></div>
<script src="http://localhost:9000/js/santo.js"></script>
</body>
@hectorgool
hectorgool / operaciones.go
Created September 4, 2017 22:10
ejemplo de testing
package operations
func Suma( a, b int) int {
return a + b
}
func Resta( a, b int) int {
return a - b
}
@hectorgool
hectorgool / elasticsearch_bulk.go
Created September 1, 2017 01:11
Load a huge file faster in Elasticsearch Server
/*
twitter@hector_gool
https://github.com/olivere/elastic/wiki/BulkIndex
*/
package main
import (
"fmt"
elastic "gopkg.in/olivere/elastic.v5"
"encoding/csv"
@hectorgool
hectorgool / read_csv_file.go
Created August 24, 2017 22:21
How to read a csv file in golang
/*
twitter@hector_gool
*/
package main
import (
"encoding/csv"
"fmt"
"os"
@hectorgool
hectorgool / generate_curls.go
Created August 24, 2017 20:55
Read a csv file To dynamically create json objects with file data
/*
twitter@hector_gool
*/
package main
import (
"encoding/csv"
"fmt"
"os"
@hectorgool
hectorgool / multiline_strings.go
Last active August 23, 2017 22:05
How to create multiline strings in Golang
/*
How to create multiline strings in Golang
twitter@hector_gool
https://play.golang.org/p/iR5Tt-iwSR
*/
package main
import (
"fmt"
@hectorgool
hectorgool / elasticserach_creat_mapping.go
Last active August 22, 2017 23:36
Delete and create an elasticsearch mapping
/*
twitter@hector_gool
*/
package main
import (
"fmt"
"os"
"os/exec"
@hectorgool
hectorgool / curl.go
Created August 22, 2017 23:33
exec curl
/*
twitter@hector_gool
*/
package main
import (
"fmt"
"os"
"os/exec"
/*
twitter@hector_gool
Yoy can download MX.txt file from the next site:
http://download.geonames.org/export/zip/MX.zip
*/
package main
import (