Skip to content

Instantly share code, notes, and snippets.


Jose Quintana joseluisq

View GitHub Profile
joseluisq /
Created Sep 2, 2020 — forked from krisleech/
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

joseluisq / slugify.ts
Created Aug 18, 2020
Custom Typescript slugify function
View slugify.ts
export function slugify (text: string, separator = "-", ampersand = "and") {
const a = "àáäâèéëêìíïîòóöôùúüûñçßÿỳýœæŕśńṕẃǵǹḿǘẍźḧ"
const b = "aaaaeeeeiiiioooouuuuncsyyyoarsnpwgnmuxzh"
const p = new RegExp(a.split("").join("|"), "g")
return text.toString().toLowerCase()
// Replace whitespaces and underscores with single hyphens
.replace(/[\s_]+/g, separator)
// Replace special chars
.replace(p, (c) => b.charAt(a.indexOf(c)))
joseluisq /
Last active Aug 10, 2020
How to get just the name of first Docker service running

How to get just the name of first Docker service running

Following command will get just the name of the first Docker service running (usually the last one deployed) of a list of N services with running/shutdown/etc status.

Format name: service_name.N.ID

docker service ps my_service_name \
    --no-trunc --format="{{.Name}}.{{.ID}}/{{.DesiredState}}" | grep "Running" | cut -f1 -d "/" | head -n1
# my_service_name.1.abcd1v23ui456pyu7lx8k9fze
joseluisq / docker-compose.yml
Last active Aug 10, 2020
How to run InfluxData Telegraf using Docker compose in order to collect host and containers metrics
View docker-compose.yml
version: "3"
image: telegraf:1.14-alpine
HOST_ETC: /hostfs/etc
HOST_PROC: /hostfs/proc
HOST_SYS: /hostfs/sys
joseluisq / BENCHMARK
Created Apr 8, 2020
Rust web frameworks benchmark focus on static-file serving.
This is an opinioned benchmark that I have made for testing some Rust web frameworks focus on static-file serving feature using the minimal code that every framework provides.
Yes! This can vary per use case and is just another "benchmark".
OS: Arch Linux
Kernel: Linux 5.6.2-arch1-2 x86_64
$ rustc -vV
rustc 1.42.0 (b8cedc004 2020-03-09)
joseluisq / .emacs
Created Feb 28, 2020
Checking for a specific Emacs version on .emacs file
View .emacs
;; Emit a warning when Emacs version is not greater or equal to 24.1
(when (and (<= emacs-major-version 24) (< emacs-minor-version 1))
(warn (format "\
Emacs v%s.%s is not supported for this configuration. Try to upgrade to v24.1+." emacs-major-version emacs-minor-version)))
;; Continue installing MELPA packages etc...
joseluisq /
Last active Feb 25, 2020 — forked from mihow/
Load environment variables from a .env file from a Bash shell script
#!/usr/bin/env bash
set -e
set -u
if [ -f .env ]; then
export $(cat .env | xargs)
echo ".env file not found"
joseluisq /
Last active Feb 17, 2020
Testing download file speed using cUrl and get its stats into a log file. Unix-like systems only.
# For customize the writeout take a look at
curl -Skw "\
CURL download file testing\n\
URL: %{url_effective}\n\
Response code: %{response_code}\n\
Download size: %{size_download}B\n\

XPath v1.0 searching

Search all attributes in a xml node


Search all namespaces in a xml node

joseluisq / programming_languages_keywords.json
Last active Sep 14, 2020
JSON of programming languages and their keywords. Additionally it contains a summary and extensions. Originally adapted from
View programming_languages_keywords.json
"data": [
"name": "Lua",
"version": 5.3,
"summary": "Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming and data description.",
"extensions": [
"keywords": [
You can’t perform that action at this time.