Skip to content

Instantly share code, notes, and snippets.

View RanKey1496's full-sized avatar
🎯
Focusing

Jhon Gil Sepulveda RanKey1496

🎯
Focusing
  • Medellín - Colombia
View GitHub Profile
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:postgresql://host:5432/database
username: 123
password: 123
hikari:
minimum-idle: 9
@RanKey1496
RanKey1496 / docker-letsencrypt
Created October 22, 2018 21:32
Generate wildcard certificates with Docker
docker run -it --rm --name letsencrypt \
-v /letsencrypt/etc/letsencrypt:/etc/letsencrypt \
-v /letsencrypt/var/lib/letsencrypt:/var/lib/letsencrypt \
quay.io/letsencrypt/letsencrypt:latest \
certonly \
-d domain.com \
-d *.domain.com \
--manual \
--preferred-challenges dns \
--server https://acme-v02.api.letsencrypt.org/directory
@RanKey1496
RanKey1496 / gist:223bd1e4f6853bd1c3c9f23dba3de7e8
Created October 16, 2018 04:40 — forked from yunghoy/gist:a425f91824d26461bb2e3653bc56ebbf
AMQP library (RabbitMQ) - async/await
alias babel-node='babel-node --presets stage-0'
------ RECV ------
// babel-node recv2.js "#"
// babel-node recv2.js "kern.*"
const amqp = require('amqplib');
const args = process.argv.slice(2);
if (args.length == 0) {
@RanKey1496
RanKey1496 / socket-cheatsheet.js
Created October 16, 2018 04:40 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@RanKey1496
RanKey1496 / geospatialMYSQL.sql
Created March 8, 2018 16:20
Geospatial query that search properties nearby to a point
SELECT
prom.id, p.id, p.direccion, p.latitud, p.longitud,
(
6371 *
ACOS(
COS( RADIANS( 6.250020 ) ) *
COS( RADIANS( `latitud` ) ) *
COS(
RADIANS( `longitud` ) - RADIANS( -75.568510 )
) +