Skip to content

Instantly share code, notes, and snippets.

Jose Quintana joseluisq

Block or report user

Report or block joseluisq

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joseluisq
joseluisq / BENCHMARK
Created Apr 8, 2020
Rust web frameworks benchmark focus on static-file serving.
View BENCHMARK
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
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
joseluisq / dotenv.sh
Last active Feb 25, 2020 — forked from mihow/load_dotenv.sh
Load environment variables from a .env file from a Bash shell script
View dotenv.sh
#!/usr/bin/env bash
set -e
set -u
if [ -f .env ]; then
export $(cat .env | xargs)
else
echo ".env file not found"
fi
@joseluisq
joseluisq / download_testing_stats.sh
Last active Feb 17, 2020
Testing download file speed using cUrl and get its stats into a log file. Unix-like systems only.
View download_testing_stats.sh
#!/bin/bash
# For customize the writeout take a look at https://ec.haxx.se/usingcurl/usingcurl-verbose/usingcurl-writeout
curl -Skw "\
CURL download file testing\n\
==========================\n\
URL: %{url_effective}\n\
Response code: %{response_code}\n\
Download size: %{size_download}B\n\
View xpath_searching.md

XPath v1.0 searching

Search all attributes in a xml node

//my-node/attribute::*

Search all namespaces in a xml node

@joseluisq
joseluisq / programming_languages_keywords.json
Last active Jan 15, 2020
JSON of programming languages and their keywords. Additionally it contains a summary and extensions. Originally adapted from https://github.com/leighmcculloch/keywords
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": [
"lua"
],
"keywords": [
@joseluisq
joseluisq / get_into_docker_image.md
Last active Feb 25, 2020
How do you get into a Docker image?
View get_into_docker_image.md

How do you get into a Docker image?

We can do this running our image interactively which creates a temporary container for:

docker run --rm -it \
    --name my_container \
    --volume $PWD:/some_dir_in_container \
    --workdir /some_dir_in_container \
    golang:1.13-buster bash
@joseluisq
joseluisq / mirror_git_repo_using_no_mirror.md
Last active Nov 28, 2019
Mirroring a Git repository (no git --mirror)
View mirror_git_repo_using_no_mirror.md

Mirroring a Git repository (no git --mirror)

git push --tags --progress git@github.com:joseluisq/tslint-config-standard-plus.git refs/heads/*:refs/heads/*

Note: --tags will push all local tags as well.

References:

@joseluisq
joseluisq / logrotator.js
Created Oct 11, 2019
Write a log file with rotation option in Node JS
View logrotator.js
const streamFileArchive = require("stream-file-archive")
const Stream = require("stream")
/**
* Write a log file with rotation option
*
* @param {String} path Log file path
* @param {String} symlink Log file path symlink (latest log file)
* @param {String} separator String seprator for log data (E.g. separator for array of strings passed into `write` method)
*/
@joseluisq
joseluisq / minify_xml.js
Last active Oct 11, 2019
XML Minifier in Javascript / NodeJS
View minify_xml.js
/**
* A tool to minify XML strings
* This code was borrowed and adapted from vkbeautify xml
* https://github.com/vkiryukhin/vkBeautify/blob/master/vkbeautify.js
*/
function XMLMinifier () {
function xml(text, step = "\t") {
const ar = text
.replace(/>\s{0,}</g, "><")
.replace(/</g, "~::~<")
You can’t perform that action at this time.