Skip to content

Instantly share code, notes, and snippets.

View pzentenoe's full-sized avatar

pzenteno pzentenoe

View GitHub Profile
@pzentenoe
pzentenoe / MyUnitTest.java
Last active September 15, 2017 15:47
Uso de Mockito doAnswer() callbacks
import org.mockito.Mockito;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.testng.Assert;
import org.testng.annotations.Test;
public class MyUnitTest {
int executions;
class ServiceA {
final ServiceB runner;
@pzentenoe
pzentenoe / mgoExample.go
Created November 6, 2017 17:57 — forked from border/mgoExample.go
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@pzentenoe
pzentenoe / comunas-regiones.json
Created July 21, 2018 17:08 — forked from juanbrujo/comunas-regiones.json
Comunas y regiones de chile JSON
{
"regiones": [{
"region": "Arica y Parinacota",
"comunas": ["Arica", "Camarones", "Putre", "General Lagos"]
},
{
"region": "Tarapacá",
"comunas": ["Iquique", "Alto Hospicio", "Pozo Almonte", "Camiña", "Colchane", "Huara", "Pica"]
},
@pzentenoe
pzentenoe / comunas.json
Created July 21, 2018 17:08 — forked from gonzalo-bulnes/comunas.json
Comunas de Chile (seed Ruby on Rails, JSON) - (see also https://github.com/gonzalo-bulnes/chilean_cities)
[
{
"name": "Arica",
"code": "15101",
"provincia": "Arica",
"region": "Arica y Parinacota",
"region_number": "XV",
"region_iso_3166_2": "CL-AP"
},
{
@pzentenoe
pzentenoe / token-util.go
Last active October 1, 2018 19:05 — forked from cryptix/LICENSE
Ejemplo de codigo de jwt generacion y validacion
package main
// using asymmetric crypto/RSA keys
import (
"crypto/rsa"
"fmt"
"io/ioutil"
"log"
"net/http"
@pzentenoe
pzentenoe / rectangle.dart
Created February 22, 2019 16:47
Ejemplo de parametros opcionales en dart
import 'dart:math';
class Rectangle {
int width;
int height;
Point origin;
Rectangle({this.origin = const Point(0, 0), this.width = 0, this.height = 0});
@override
@pzentenoe
pzentenoe / autentication-facebook.go
Last active April 8, 2019 16:26
Autenticacion con facebook con go y metodos para obtener informacion de usuario logeado
package handlers
import (
"encoding/json"
"fmt"
"github.com/labstack/echo"
"gitlab.com/skolldevs-backend/indahouse-api/database"
"gitlab.com/skolldevs-backend/indahouse-api/models"
"golang.org/x/oauth2"
"golang.org/x/oauth2/facebook"
@pzentenoe
pzentenoe / docker-compose.yml
Created April 22, 2019 01:04
Ejemplo de docker-compose con un stack mean
# Vamos a definir los servicios y contenedores a usar
version: '3'
services:
# Preparamos el cliente
angular:
image: angular-cli:v1 #
ports:
- "4200:4200" # Puerto del cliente
# Preparamos el servidor
servidor:

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by