Skip to content

Instantly share code, notes, and snippets.

Avatar
🌏
Working from home

Ed Paz eddwinpaz

🌏
Working from home
  • Servicios de tecnologías de la información SpA
  • CL
View GitHub Profile
@eddwinpaz
eddwinpaz / dni_peru_validate.js
Created Apr 16, 2020 — forked from lgaticaq/dni_peru_validate.js
Función para validar DNI Peruano
View dni_peru_validate.js
/**
* Verifica que un DNI de Perú sea valido
* @param {String} data DNI
* @returns {Boolean}
*/
const validate = data => {
const dni = data.replace('-', '').trim().toUpperCase()
if (!dni || dni.length < 9) return false
const multiples = [3, 2, 7, 6, 5, 4, 3, 2]
const dcontrols = {
@eddwinpaz
eddwinpaz / .js
Created Mar 17, 2020
notification-service
View .js
const notificationService = async function(fastify, request) {
let {
message: {
attributes: { eventType, entityId }
}
} = request.body;
const order = await getOrderDomainInformation(fastify, request);
let response;
@eddwinpaz
eddwinpaz / .js
Created Mar 17, 2020
serviceGetOrderByOrderId
View .js
const serviceGetOrderByOrderId = async (fastify, request) => {
// decode base64 and parse to JSON object
// console.log("==== serviceGetOrderByOrderId ====");
// console.log(request);
// console.log("========");
const {
message: {
attributes: { entityType, entityId, siteId, country },
data: data
@eddwinpaz
eddwinpaz / .js
Created Mar 17, 2020
issue with fastify
View .js
/* order domain information mock (jest) */
const mock_order_domain_information = orderJSON(1);
/* Notification Request Body */
const request_notification_service = {
body: {
message: {
attributes: {
eventType: ORDER_CREATED,
entityId: "d151c52e-3ad1-11ea-b77f-2e728ce88125",
@eddwinpaz
eddwinpaz / hello-world-app.yaml
Created Jan 9, 2020 — forked from mhausenblas/hello-world-app.yaml
Answer to StackOverflow 52200448
View hello-world-app.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
run: hello-world
name: hello-world
namespace: default
spec:
selector:
matchLabels:
@eddwinpaz
eddwinpaz / golang.gitlab-ci.yml
Created Aug 19, 2019 — forked from npenkov/golang.gitlab-ci.yml
gitlab-ci for Go projects using go dep.
View golang.gitlab-ci.yml
# Replace "projectname" and "username"
image: golang:1.9
variables:
BIN_NAME: projectname
ARTIFACTS_DIR: artifacts
GO_PROJECT: gitlab.com/username/projectname
stages:
- build
View SimpleRecyclerView.java
package com.saber.customstickyheader;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
View k8s-dashboard-admin-user.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: admin-user