Skip to content

Instantly share code, notes, and snippets.

View damiancipolat's full-sized avatar
💭
Creating amazing things!

DamCipolat damiancipolat

💭
Creating amazing things!
View GitHub Profile
@damiancipolat
damiancipolat / dynamo_dynamic_update.js
Created September 24, 2020 03:12
An example of make a dynamic object update using dinamodb and nodejs.
const AWS = require('aws-sdk');
//Define aws region
AWS.config.update({
region:'us-east-1'
});
const TABLE = 'dc_test';
@damiancipolat
damiancipolat / SQS - consumer node.js
Last active October 17, 2020 05:53
A node.js example using the aws-sdk to consumer data
const AWS = require('aws-sdk');
AWS.config.update({
region: 'us-east-1'
});
const SQS = new AWS.SQS();
const {
Consumer
@damiancipolat
damiancipolat / SQS - producer node.js
Last active October 17, 2020 05:57
sqs-producer.js
const AWS = require('aws-sdk');
AWS.config.update({
region: 'us-east-1'
});
const sqs = new AWS.SQS({
apiVersion: '2012-11-05'
});
@damiancipolat
damiancipolat / arrayFunctions.js
Created August 18, 2021 15:24
Javascript special array set operations
/*
Return the sets intersection.
Params
arrA : array
arrB : array
Return
array
*/
const intersection = (arrA,arrB) => arrA.filter(x => arrB.includes(x));
@damiancipolat
damiancipolat / transposeMatrix.ts
Created October 18, 2021 00:24
Transponer matrices de 2 dimensione
/*
Transponer una matriz
Entrada:
1 2 3 4
5 6 7 8
Salida
1 5
2 6
@damiancipolat
damiancipolat / binaryTreeCount.ts
Created October 18, 2021 00:43
Cuenta hojas de un arbol binario
// Se espera que el resultado lo muestres en un console.log
const arbol = {
num: 25,
izq: {
num: 23,
izq: {
num: 10,
},
der: {
num: 80,
@damiancipolat
damiancipolat / linked_list_remove_nodes.js
Created October 18, 2021 23:16
En este ejercicio se debe borrarn de las listas vinculadas los valores que sean menores a 100 y retornarlo por consola.
const year = {
num: 2019,
month: {
num: 1,
avgDollarValue: 90,
month: {
num: 2,
avgDollarValue: 105,
month: {
num: 0,
@damiancipolat
damiancipolat / sql_server_silent_install.bat
Last active November 30, 2021 15:48
SQL SERVER Instalación silenciosa
# Descargar el instalador desde aqui:https://www.microsoft.com/en-us/download/details.aspx?id=101064 bajar ".exe"
# Version SQL SERVER 2019 - EXPRESS
# Basado en esta web: https://silentinstallhq.com/microsoft-sql-server-2019-express-silent-install-how-to-guide
@echo off
echo "1) Creo directorio temporal..."
mkdir c:\crypton-install-tmp
echo "Ok"
echo "2) Extraigo instalador .exe..."
@damiancipolat
damiancipolat / sql_remove_duplicates.sql
Created February 10, 2022 01:16
An sql example to remove duplicate fields in a table from by one column.
drop table testtb;
drop table test_duplicated;
drop table test_unique;
create temporary table testtb (
entity varchar(10) not null,
duplicate varchar(10) not null
);
insert into testtb
@damiancipolat
damiancipolat / tag.sh
Created April 4, 2022 00:04
Docker tagger using package.json version field.
#Extract project field name package.json
export PACKAGE_NAME="$(cat package.json | grep name | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g')"
#Extract version field from package.json
export PACKAGE_VERSION="$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g')"
#Set the package tag name
export PACKAGE_TAG="$(echo ${PACKAGE_NAME}:${PACKAGE_VERSION} | tr -d ' ')"