Skip to content

Instantly share code, notes, and snippets.

View vinikira's full-sized avatar

Vinícius da Costa Simões vinikira

View GitHub Profile
anonymous
anonymous / wrap-middleware.js
Created September 16, 2017 20:50
const Boom = require('boom')
/**
* call a middleware
* @method tryCatch
* @param {Function} fn
* @return {Promise}
*/
const tryCatch = fn => {
try {
@kissge
kissge / emacs26.sh
Created December 3, 2017 13:24
Compile Emacs 26 on Ubuntu 16.04 on Windows Subsystem for Linux (WSL, aka Bash on Ubuntu on Windows)
mkdir emacs
cd emacs
git init
git remote add origin https://github.com/emacs-mirror/emacs.git
git fetch --depth 1 origin emacs-26
git reset --hard FETCH_HEAD
sudo apt install autoconf make gcc texinfo libgtk-3-dev libxpm-dev libjpeg-dev libgif-dev libtiff5-dev libgnutls-dev libncurses5-dev
./configure
make
sudo make install
@nirev
nirev / Dockerfile
Last active June 30, 2020 14:03
Elixir docker deployment
ARG OTP_VERSION=22.0
##################################################
# Base - setup project and docker cache for build
FROM erlang:${OTP_VERSION}-alpine as base
# elixir expects utf8.
ENV ELIXIR_VERSION="v1.9.1" \
LANG=C.UTF-8
@edenc
edenc / nutricao.org
Last active February 12, 2021 23:48
Acompanhamento Nutricional utilizando org-mode

introdução

Essas tabelas tem como objetivo calcular a ingestão diária de nutrientes para dietas controladas. Elas permitem o acompanhamento minucioso. Importante para atletas e regimes alimentares.

A estratégia consiste em calcular o quociente alimentar por grama, de cada propriedade nutriente do alimento e depois multiplicar esse quociente por cada produto numa tabela de acompanhamento diário.

@lpf23
lpf23 / CNTLM Proxy - Centos
Last active May 11, 2022 08:29
Configure CNTLM Proxy on Centos/Ubuntu
1) Download cntlm rpm package from http://sourceforge.net/projects/cntlm/files/cntlm/
2) Login as root
3) Run command:
$ rpm -ivh cntlm-*.rpm
4a) Obtain password hash for the configuration file in step 4b (do not put plaintext password in configuration)
$ cntlm -H -d <domain> -u <username>
@rougier
rougier / clean.el
Created May 10, 2020 02:43
A very minimal but elegant emacs configuration file
(require 'org)
(setq-default indent-tabs-mode nil)
(setq org-display-inline-images t)
(setq org-redisplay-inline-images t)
(setq org-startup-with-inline-images "inlineimages")
(setq default-frame-alist
(append (list '(width . 72) '(height . 40))))
@vinicius73
vinicius73 / 0-contribua-.md
Last active February 9, 2024 10:10
Guia de referencias sobre estudo de JavaScript

Contribua

Se você quiser adicionar mais algum tópico deixe seu comentário, o objetico é facilitar para os iniciantes ou aqueles que buscam dominar JavaScript, quais tópicos são importantes para dominar JavaScript.

São tópicos para quem sabe o minimo de JavaScript (declarar variáveis), a ordem em que eles aparecem são por importância para o dominio como um todo. Mesmo que você já tenha experiência com JS, recomendo que leia os links de cada tópico para fortalecer suas bases teóricas e ter um comportamento mais profundo da linguagem.

Lista originalmente criada e compilada por Vinicius Reis

@pvik
pvik / smartparens-cheatsheet.md
Last active March 17, 2024 03:29
A Cheatsheet for Emacs Smarparens example configuration

An animated cheatsheet for smartparens using the example configuration specified here by the smartparens author. Inspired by this tutorial for paredit.

Traversal

C-M-f sp-forward-sexp
C-M-b sp-backward-sexp

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)