Skip to content

Instantly share code, notes, and snippets.

View Dviejopomata's full-sized avatar
🏠
Working from home

Dviejo Dviejopomata

🏠
Working from home
  • Alicante, Spain
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
namespace ExcelToCsv
@Dviejopomata
Dviejopomata / package.json
Created June 19, 2018 16:05
Prueba arduino web api
{
"name": "node-server",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"@types/express": "^4.16.0",
"@types/node": "^10.3.4",
"body-parser": "^1.18.3",
"express": "^4.16.3",
@Dviejopomata
Dviejopomata / prueba.csv
Created June 19, 2018 21:16
Copy from postgres with curl and JSON field
nombre { "hello":"world1" }
DAVID {}
JOSE {}
@Dviejopomata
Dviejopomata / future-example.kt
Created June 25, 2018 15:25
Kotlin future example
import kotlinx.coroutines.experimental.guava.future
import kotlin.system.measureTimeMillis
fun main(arr: Array<String>): Unit {
var metadata = "vavlue"
val t = measureTimeMillis {
val f = future {
val v = 1
Thread.sleep(1500)
@Dviejopomata
Dviejopomata / app.component.html
Last active July 2, 2018 22:35
Directive like *ngIf
<h1 *appAuthorization="{resource:'app',operation:'read'}">You now have access to read the resource app</h1>
const vm = require("vm")
const Module = require("module")
const array = [1, 2, 3, 4, 5, 6]
const exp = "n => n === 5"
const script = new vm.Script(`
module.exports = (array, exp) => {
return array.filter(eval(\`\${exp}\`))
}
`)
const sandbox = Object.assign(
cat <<EOF | kubectl create -f -
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard
labels:
k8s-app: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
const fs = require('fs');
const readline = require('readline');
const { google } = require('googleapis');
// codigo de acceso 4/SQBCzOPQn-xHeDBJ3j1LmaSNxP7Hlk62BvrZoPBUk3KgVCqSqvP2ezQ
// If modifying these scopes, delete token.json.
const SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly'];
const TOKEN_PATH = 'token.json';
// Load client secrets from a local file.
fs.readFile('credentials.json', (err, content) => {
@Dviejopomata
Dviejopomata / docker-compose.yml
Last active September 5, 2018 09:28
Postgres master slave
version: '3'
services:
pg-master:
restart: always
image: sameersbn/postgresql:10
volumes:
- pg-master:/var/lib/postgresql
ports:
- "5434:5432"
package build
import (
"context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/builder/dockerignore"
"github.com/docker/docker/builder/remotecontext/git"
"github.com/docker/docker/client"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/idtools"