This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2.1" | |
services: | |
plantuml-container: | |
image: "plantuml/plantuml-server:jetty" | |
antora: | |
image: "jagedn/antora-plantuml" | |
depends_on: | |
plantuml-container: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller("/test") | |
class FileController{ | |
@Get(value = "/{file}", produces = MediaType.IMAGE_GIF) | |
Flowable<byte[]> image(@PathVariable String file) { | |
Flowable.create({ emitter -> | |
new File(file).withInputStream{ inputStream -> | |
int size=1024 | |
byte[]buff = inputStream.readNBytes(size) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.imageio.ImageIO | |
json = new groovy.json.JsonSlurper().parse("https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY".toURL()) | |
url = json.url | |
ext = url.split('\\.').last().toLowerCase() | |
if( ['jpg','png','jpeg'].contains(ext) == false ){ | |
return | |
} | |
image = ImageIO.read(url.toURL()) | |
g = image.graphics | |
g.font = g.font.deriveFont(25f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.util.slurpersupport.GPathResult | |
new File("madrid").deleteDir() | |
new File("madrid").mkdirs() | |
xml = 'http://informo.munimadrid.es/informo/tmadrid/CCTV.kml'.toURL().getText("ISO-8859-1") | |
xml = xml.substring(xml.indexOf('<')) // el kml tiene caracteres erróneos al principio, así es Madrid | |
kml = new XmlSlurper().parseText(xml).declareNamespace("xmlns":"http://earth.google.com/kml/2.2") | |
kml.Document.Placemark.sort{ | |
it.ExtendedData.Data[1].Value.text() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onOpen(e) { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createAddonMenu().addItem('RandomAula', 'raffle').addToUi(); | |
} | |
var urls = [ | |
"https://media.giphy.com/media/3oriffRGkX9U7Tmphu/giphy.gif", | |
"https://media.giphy.com/media/3HGDE05UoQ0tmQpTzz/giphy.gif", | |
"https://media.giphy.com/media/THVQ8w1Yc2Eg8aUU0S/giphy.gif", | |
"https://media.giphy.com/media/euGKUsOE7FWMxIjmf9/giphy.gif" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onOpen(e) { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createAddonMenu().addItem('RandomAula', 'raffle').addToUi(); | |
} | |
var urls = [ | |
"https://media.giphy.com/media/3oriffRGkX9U7Tmphu/giphy.gif", | |
"https://media.giphy.com/media/3HGDE05UoQ0tmQpTzz/giphy.gif", | |
"https://media.giphy.com/media/THVQ8w1Yc2Eg8aUU0S/giphy.gif", | |
"https://media.giphy.com/media/euGKUsOE7FWMxIjmf9/giphy.gif" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function telegram(){ | |
var bot = 'XXXXXX:YYYYYYYYYYYYY' | |
var chatId = 'CHANNEL_ID' | |
var url = 'https://api.telegram.org/bot'+bot | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getActiveSheet(); | |
var rangeData = sheet.getDataRange(); | |
var lastColumn = rangeData.getLastColumn(); |