Skip to content

Instantly share code, notes, and snippets.

@adamatti
adamatti / 00_README.md
Last active Nov 1, 2019
Meetup Micronaut #meetup #micronaut
View 00_README.md
@adamatti
adamatti / README.adoc
Last active Nov 1, 2019
Sending a message to AWS / local #sample #aws
View README.adoc

Required

How to run:

  • Start AWS local: docker run -p 4576:4576 -p 8080:8080 -e SERVICES=sqs localstack/localstack

  • Optional: create file payload.json with your content

View index.js
const express = require('express');
const app = express();
app.get('/health', function (req, res) {
res.send('Hello World!');
});
app.get('/jokenpo', function (req, res) {
let jogadaJogador1 = req.query.jogador1;
let jogadaJogador2 = req.query.jogador2;
@adamatti
adamatti / README.md
Last active Nov 1, 2019
Docker commands #docker
View README.md
  • stop all containers: docker stop $(docker ps -q)
  • delete all containers: docker rm $(docker ps -aq)
  • delete all images: docker rmi $(docker images -q)
@adamatti
adamatti / remove-docker-containers.md
Last active Nov 1, 2019 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images #docker
View remove-docker-containers.md
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@adamatti
adamatti / BubbleSortTest.py
Last active Nov 1, 2019
Resultado do dojo de python - 04/05/2017 #dojo
View BubbleSortTest.py
import unittest
from sort import BubbleSort
class BubbleSortTest(unittest.TestCase):
def setUp(self):
self.bubble_sort = BubbleSort()
def testSortEmptyList(self):
lista = []
@adamatti
adamatti / README.adoc
Last active Nov 1, 2019
Exemplos usados no dojo de clojure - 27/04/2017 #dojo #clojure
@adamatti
adamatti / coelho_test.js
Last active Nov 1, 2019
Resultado DOJO de node - 20/04/2017 #dojo
View coelho_test.js
const assert = require('assert')
it ("primeiro caso - R2", () => {
assert.equal ( pula('R2') , 2 )
})
it ("segundo caso - R3", () => {
assert.equal ( pula('R3') , 3 )
})
@adamatti
adamatti / Jokenpo.groovy
Last active Nov 1, 2019
Dojo do RSJUG - 30/04/2017 #dojo
View Jokenpo.groovy
class Jokenpo{
def banzai(j1, j2)
{
if (j1 == j2) return "empate"
[
pedra: "tesoura",
papel: "pedra",
tesoura :"papel"
].find { k, v ->
@adamatti
adamatti / blogs_slides_gits.adoc
Last active Nov 1, 2019
Some Links from Ilegra #ilegra
View blogs_slides_gits.adoc
  • Alex Rocha [ blog | git ]

  • Alexandre Poletto [ git ]

  • Ariel Moraes [ git ]

  • Christophe Marchal [ blog | git | slides ]

  • Cleber Henriques [ git ]

  • Diego Pacheco [ blog | git ]

  • Douglas Nomizo [ git ]

  • Eduardo Rost [ git ]

  • Henrique Morbin [ git ]

  • Humberto Streb [ git ]