Skip to content

Instantly share code, notes, and snippets.

/*
http://json2struct.mervine.net/
https://mholt.github.io/json-to-go/
http://stackoverflow.com/questions/26511417/unmarshal-json-data-in-a-specific-struct-in-golang
{
"cp": "81270",
"colonia": "Villa de Cortes",
"ciudad": "Sinaloa",
"delegacion": "Ahome",
/*
https://github.com/olivere/elastic/issues/286
https://libraries.io/go/github.com%2Fmagicshui%2Felastic
https://github.com/olivere/elastic/issues/130
https://olivere.github.io/elastic/
*/
package main
import (
[
{
"cp": "03530",
"colonia": "Villa de Cortes",
"ciudad": "Distrito Federal",
"delegacion": "Benito Juarez",
"location": {
"lat": "19.3487",
"lon": "-99.166"
package main
import (
"fmt"
j "github.com/ricardolonga/jsongo"
"gopkg.in/olivere/elastic.v3"
)
func main() {
@hectorgool
hectorgool / index.android.js
Created January 21, 2017 18:40
React Native
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
#!/usr/bin/perl -w
#aptitude install libdbd-pg-perl libdbi-perl -y
use DBI;
system("clear");
my $dbh = DBI->connect("DBI:Pg:dbname=hem;host=localhost", "hem", "asdfasdf", {'RaiseError' => 1});
$sth = $dbh->prepare("SELECT * FROM products ORDER BY name");
@hectorgool
hectorgool / objetivos.txt
Created March 17, 2017 18:13
fw_migracion.pl
#!/usr/bin/perl -w
system("clear");
open( F, "objetivos.txt" ) || die "Error al abrir archivo";
@centros = <F>;
$contador = 0;
foreach ( @centros ) {
#!/usr/bin/perl -w
# Tabla «public.centro»
# Columna | Tipo | Modificadores
# ---------------+-----------------------------+------------------------
# id | integer | not null
# ip | character varying(15) | not null
# hostname | text | not null
# nombre | text |
# alias | character varying(50) |
@hectorgool
hectorgool / validate.html
Last active April 17, 2017 13:12
vee validation test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Vue.js Tutorial | API Example</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">