This file contains hidden or 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
| /* | |
| go ftm postgresql_api.go | |
| go build postgresql_api.go | |
| install: | |
| go get github.com/lib/pq | |
| CREATE DATABASE "social_network" WITH ENCODING 'UTF8'; | |
| GRANT ALL ON DATABASE "social_network" TO santo; | |
| CREATE SEQUENCE users_id_seq | |
| START WITH 1 |
This file contains hidden or 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
| db.offert.remove({}) | |
| db.offert.insert( | |
| { | |
| "_id" : ObjectId().str, | |
| "name" : "Nombre de la Oferta 1", | |
| "cost" : "5000", | |
| "course" : { | |
| "name" : "Nombre del Curso 1", |
This file contains hidden or 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
| /* | |
| curl -X PUT "http://localhost:9200/mx2/postal_code/1" -d " | |
| { | |
| \"cp\" : \"20000\", | |
| \"colonia\" : \"Zona Centro\", | |
| \"ciudad\" : \"Aguascalientes\", | |
| \"delegacion\" : \"Aguascalientes\", | |
| \"location\": { | |
| \"lat\": \"22.0074\", |
This file contains hidden or 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
| /* | |
| go get -t | |
| curl -XPOST -d'{"s":"hello, world"}' localhost:8080/uppercase | |
| curl -XPOST -d'{"s":"hello, world"}' localhost:8080/count | |
| */ | |
| package main | |
| import ( | |
| "encoding/json" | |
| "errors" |
This file contains hidden or 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
| /* | |
| https://astaxie.gitbooks.io/build-web-application-with-golang/content/en/05.4.html | |
| CREATE DATABASE "prueba" WITH ENCODING 'UTF8'; | |
| CREATE USER "santo" WITH PASSWORD 'asdfasdf'; | |
| GRANT ALL ON DATABASE "prueba" TO santo; | |
| CREATE TABLE userinfo | |
| ( | |
| uid serial NOT NULL, |
This file contains hidden or 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
| /* | |
| http://stackoverflow.com/questions/26411594/executing-docker-command-using-golang-exec-fails | |
| */ | |
| package main | |
| import ( | |
| "fmt" | |
| "os/exec" | |
| ) |
This file contains hidden or 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 ( | |
| "encoding/json" | |
| "fmt" | |
| "reflect" | |
| elastic "gopkg.in/olivere/elastic.v3" | |
| ) |
This file contains hidden or 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
| #!/usr/bin/perl | |
| system("clear"); | |
| open( F, "id_attachment.txt" ) || die "Error al abrir archivo"; | |
| @base = <F>; | |
| $contador = 0; | |
| foreach ( @base ) { |
This file contains hidden or 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 Admin::ToursController < Admin::ApplicationController | |
| before_action :set_tour, only: [:edit, :update, :destroy] | |
| def new | |
| @tour = Tour.new | |
| #3.times { @tour.attachments.build } | |
| @tour.attachments.build | |
| end |
This file contains hidden or 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 | |
| /* | |
| { | |
| "query": { | |
| "match": { | |
| "_all": { | |
| "operator": "and", | |
| "query": "Rodolfo Guzman Huerta" | |
| } |