This file contains 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
// source https://www.ine.es/daco/daco42/nombyapel/nombres_por_edad_media.xls | |
const names = [ | |
"ANTONIO", | |
"MANUEL", | |
"JOSE", | |
"FRANCISCO", | |
"DAVID", | |
"JUAN", | |
"JOSE ANTONIO", | |
"JAVIER", |
This file contains 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
{ | |
"swagger": "2.0", | |
"info": { | |
"description": "API with big latency", | |
"version": "1.0.0", | |
"title": "Latency API", | |
"termsOfService": "https://www.tid.es", | |
"contact": { | |
"name": "Fake Identity", | |
"email": "[email protected]" |
This file contains 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
# Dependencias urar y rarfile | |
# Instalar: | |
# Mac: brew install unrar | Ubuntu: apt-get install rar unrar | |
# pip install rarfile | |
import os | |
import shutil | |
import rarfile | |
# Descargar el archivo zip, si hay otro archivo con el mismo nombre lo sobreescribe |
This file contains 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
// Legacy HTTP-based approach. | |
// For it to work, you need to call server.begin(); in the setup function and declare a WiFiServer server(80); | |
// see https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/SimpleWiFiServer/SimpleWiFiServer.ino | |
if (incomingClient) { | |
Serial.println("client connect"); | |
digitalWrite(LED_PIN, LOW); // LOW = ON | |
while (incomingClient.connected()) { | |
if (incomingClient.available() > 0) { |
This file contains 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
<!-- https://www.playframework.com/documentation/latest/SettingsLogger --> | |
<configuration> | |
<conversionRule conversionWord="coloredLevel" converterClass="play.api.libs.logback.ColoredLevel" /> | |
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"> | |
<providers> | |
<pattern> | |
<pattern> |
This file contains 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
#!/bin/bash | |
LOGGROUPS=$(awslogs groups | grep "/baikal/notifications-default-aws-dev/" | grep -v "mng") | |
for group in $LOGGROUPS; do | |
awslogs get $group ALL --start='10m ago' --filter-pattern=ERROR | |
done |
This file contains 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 akka.actor.ActorSystem; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import play.api.inject.DefaultApplicationLifecycle; | |
import scala.concurrent.duration.Duration; | |
import scala.concurrent.duration.FiniteDuration; | |
import sun.misc.Signal; | |
import javax.inject.Inject; | |
import javax.inject.Singleton; |
This file contains 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 controllers.binders; | |
import org.joda.time.DateTime; | |
import org.joda.time.format.ISODateTimeFormat; | |
import play.mvc.QueryStringBindable; | |
import java.util.Date; | |
import java.util.Map; | |
import java.util.Optional; |
This file contains 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 http = require('http'); | |
const url = require('url') ; | |
let server = http.createServer((req, res) => { | |
let query = url.parse(req.url, true).query; | |
res.writeHead(200, {'Content-Type': 'application/json'}); | |
setTimeout(() => { | |
res.write(JSON.stringify({success: true})); | |
res.end(); |
This file contains 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 joke | |
if not type -q jq | |
echo 'JQ is not installed' | |
end | |
curl -s -H "Accept: application/json" https://icanhazdadjoke.com/ | jq -r .joke | |
end |
NewerOlder