Skip to content

Instantly share code, notes, and snippets.

@jagedn
jagedn / Dockerfile
Created May 17, 2024 07:47
`DOCKER_BUILDKIT=1 docker build --target=runtime -t myapp .`
FROM python:3.10.12 as builder
RUN pip install poetry==1.4.2
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
WORKDIR /app
@jagedn
jagedn / index.js
Created May 8, 2024 10:14
un node para descargarse el borrador de la renta
const { Builder, By, Key, until} = require('selenium-webdriver');
const firefox = require("selenium-webdriver/firefox");
const fs = require('fs');
(async function referencia() {
var args = process.argv.slice(2);
var nif = args[0];
var fecha = args[1];
var importe = args[2];
// Gstring vs String
unString = 'Si va en comillas simples'
unGString = "si va en comillas dobles. Es parecido a una string peroo...."
// concatenar cadenas
println unString + " " + unGString
println unGString + ' y un ' + unString
@jagedn
jagedn / tuto1.groovy
Created April 11, 2024 09:37
definir cadenas simples
// igual que en java
String holaJava = "caracola";
// como en java pero sin punto y coma
String holaGroovy1 = "caracola"
// usando comillas simples
String holaGroovy2 = 'caracola'
// sin definir el tipo
@jagedn
jagedn / test.groovy
Created December 5, 2023 10:58
a simple Groovy Scritp with JMeterDSL
// requires groovy 3.0.11
// sdk install groovy 3.0.11
// sdk use groovy 3.0.11
@GrabConfig(systemClassLoader=true)
@Grab("us.abstracta.jmeter:jmeter-java-dsl:1.23.3")
import static us.abstracta.jmeter.javadsl.JmeterDsl.*
import org.apache.http.entity.ContentType
@jagedn
jagedn / example.groovy
Created November 30, 2023 16:14
GroovyScript + Datomic
// Dont know why but it requires java 17 fx
// sdk install 17.0.8.fx-zulu
// sdk use java 17.0.8.fx-zulu
@Grapes([
@Grab(group='org.scalamolecule', module='datomic-client-api-java-scala_2.13', version='1.0.3'),
@Grab(group='com.datomic', module='local', version='1.0.267'),
@Grab(group='com.cognitect', module='http-client', version='1.0.126'),
])
@jagedn
jagedn / list.js
Created November 8, 2020 19:44
frases politicamente correctas a decir cuando estas hasta la polla
const list = [
':thumbsup: no te preocupes, ahora mismo me pongo con ello',
'vale, termino una cosa :watch: y me pongo con ello asap',
'uff, bueno, lo miro y te digo algo',
'ahora mismo me pillas un poco ocupado, pero en cuanto pueda te cuento',
'Genial, no te preocupes, ya te cuento luego',
]
@jagedn
jagedn / faunadb.groovy
Created June 7, 2020 16:14
a command line CRUD for FaunaDB using GraphQL in groovy
@Grab('com.github.grooviter:gql-core:0.3.5')
@Grab('io.github.http-builder-ng:http-builder-ng-core:1.0.4')
import groovy.transform.ToString
import static groovyx.net.http.HttpBuilder.configure
import static groovyx.net.http.ContentTypes.JSON
import gql.DSL
import graphql.schema.*
@ToString
@jagedn
jagedn / docker-compose.yml
Created May 19, 2020 16:38
a docker-compose to build antora sites with plantuml diagrams
version: "2.1"
services:
plantuml-container:
image: "plantuml/plantuml-server:jetty"
antora:
image: "jagedn/antora-plantuml"
depends_on:
plantuml-container:
@jagedn
jagedn / CollatzController.kt
Last active April 30, 2020 07:42
kotlin collatz conjeture resolver
package com.puravida
import java.math.BigInteger
import javax.ws.rs.GET
import javax.ws.rs.Path
import javax.ws.rs.PathParam
import javax.ws.rs.Produces
import javax.ws.rs.core.MediaType
@Path("/hello")