Skip to content

Instantly share code, notes, and snippets.

View eddwinpaz's full-sized avatar
🌏
Working from home

Eddwin Paz eddwinpaz

🌏
Working from home
View GitHub Profile
@eddwinpaz
eddwinpaz / setup-git-precommit-hook.md
Created March 23, 2023 17:22 — forked from funmia/setup-git-precommit-hook.md
prepend git commit with ticket id
@eddwinpaz
eddwinpaz / dni_peru_validate.js
Created April 16, 2020 22:57 — forked from lgaticaq/dni_peru_validate.js
Función para validar DNI Peruano
/**
* 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 March 17, 2020 18:13
notification-service
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 March 17, 2020 18:12
serviceGetOrderByOrderId
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 March 17, 2020 17:43
issue with fastify
/* 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 January 9, 2020 00:40 — forked from mhausenblas/hello-world-app.yaml
Answer to StackOverflow 52200448
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 August 19, 2019 04:07 — forked from npenkov/golang.gitlab-ci.yml
gitlab-ci for Go projects using go dep.
# Replace "projectname" and "username"
image: golang:1.9
variables:
BIN_NAME: projectname
ARTIFACTS_DIR: artifacts
GO_PROJECT: gitlab.com/username/projectname
stages:
- build
@eddwinpaz
eddwinpaz / SimpleRecyclerView.java
Created June 24, 2019 12:09 — forked from saber-solooki/SimpleRecyclerView.java
Sticky Header RecyclerView
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;
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: admin-user