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 = { |
View .js
const notificationService = async function(fastify, request) { | |
let { | |
message: { | |
attributes: { eventType, entityId } | |
} | |
} = request.body; | |
const order = await getOrderDomainInformation(fastify, request); | |
let response; |
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 |
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", |
View hello-world-app.yaml
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
labels: | |
run: hello-world | |
name: hello-world | |
namespace: default | |
spec: | |
selector: | |
matchLabels: |
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 |