Skip to content

Instantly share code, notes, and snippets.

@phipex
phipex / install-docker.md
Created September 18, 2023 18:29 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@phipex
phipex / observer-with-proxy.ts
Created May 12, 2023 22:28
Observer pattern with ES6 Proxy in typescript
type SimpleValue = string | number | number[] | object;
class ObservableChange<T extends SimpleObject>{
propierty: keyof T;
newValue: SimpleValue
oldValue: SimpleValue
constructor(propierty: keyof T,
newValue: SimpleValue,
oldValue: SimpleValue){
https://github.com/andresgIES/PokerTestImplementation
https://github.com/santiagoocj/PokerTest
https://github.com/EsneiderLoaiza/PokerTest
https://github.com/IngRomarioSalas/PokerTest
@phipex
phipex / pg-cursor iterator example.js
Last active June 23, 2021 20:42 — forked from zachsa/pg-cursor iterator example.js
Example of how to create a row iterator using pg-cursor
const createIterator = async (sql, batchSize = 100) => {
const client = await pool.connect()
const cursor = client.query(new Cursor(sql))
return (async function getRows(client, cursor, batchSize) {
let done = false
// Get next rows
const rows = await new Promise((resolve, reject) =>
cursor.read(
@phipex
phipex / proxy.js
Created July 8, 2020 22:05 — forked from beradrian/proxy.js
CORS proxy with node-http-proxy
/** If you want to use the local development environment with the dev backend,
* this will create a proxy so you won't run into CORS issues.
* It accepts the following command line parameters:
* - port the port where the proxy will listen
* - target the DEV backend target to contact.
* Example: If you set the port to 3000 and target to https://dev.nibo.ai then
* your actual "resourceBaseUrl" in NiboSettings should be http://localhost:3000/api/v1
*/
// Define the command line options
const optionDefinitions = [

Configuracion Local Inicial

  • Instalar Nodejs (se recomienda instalar nvm para menejar varias versiones).
  • Verificar que la carpeta del proyecto tenga habilitado GIT y GitFlow.
    • Si no esta habilitado inicializar con "git init".
    • Habilitar git flow con "git flow init" (se instala con "sudo apt-get install git-flow").
  • Despues de tener todo confirmado en un commit, habilitar como proyecto de Nodejs con "npm init".
  • Instalar commitizen y commitizen-changelog con "npm install commitizen --save-dev" y "npm install cz-conventional-changelog --save-dev ".
  • Instalar standard-version con "npm i -g standard-version".
package com.example.demo;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ConcurrentHashMap;

Taller submodule

crear 3 repositorios en github con submodule1, submodule2 y mainmodule

submodule1, submodule2 y mainmodule debe contener un archivo txt con la version actual es decir que en la misma carpeta deben estar las 3 carpetas

mkdir submodule1
cd submodule1
git init
echo "inicio" &gt;&gt; version.txt
@phipex
phipex / git-branch-simplify.md
Created August 9, 2018 22:17 — forked from datagrok/git-branch-simplify.md
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is based on the javascript.lang file of GtkSourceView.
It has additional Typescript keywords defined.
Author: Johannes Bergmann
Copyright (C) 2014 Johannes Bergmann
###