Skip to content

Instantly share code, notes, and snippets.

View hesenger's full-sized avatar
The art of the sailor is to leave nothing to chance

Heber Senger hesenger

The art of the sailor is to leave nothing to chance
View GitHub Profile
@hesenger
hesenger / estados-cidades.json
Created January 27, 2024 10:17 — forked from letanure/estados-cidades.json
JSON estados cidades do brasil, dividido por estados. segunda lista atualizada em 2020, dados do IBGE
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@hesenger
hesenger / .zshrc
Last active January 16, 2024 12:48
.zshrc
# case insensitive complete
autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# prompt
custom_prompt() {
@hesenger
hesenger / Makefile
Last active December 16, 2023 17:40
Basic Makefile for dotnet projects with build, run, test and code coverage calculation
# easily create the file with this gist content using the following curl command
# curl https://gist.githubusercontent.com/hesenger/78683b600cc90687ab0a953ccbd7d934/raw > Makefile
help:
@cat Makefile
build:
@dotnet build
run:
@hesenger
hesenger / config.lua
Created April 1, 2022 12:18
Personal LunarVim config file
-- Additional Plugins
lvim.plugins = {
{"folke/tokyonight.nvim"},
{
"folke/trouble.nvim",
cmd = "TroubleToggle",
},
{ "sbdchd/neoformat" },
{ "github/copilot.vim" },
{ "f-person/git-blame.nvim" },
@hesenger
hesenger / .yml
Created April 9, 2021 00:00 — forked from nishithMobinius/.yml
bitbukcet-pipelines
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.15.3
pipelines:
branches:
test: #name of your test branch
package br.com.loumar.vendas.utils;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
@hesenger
hesenger / BaseActivity.java
Last active November 4, 2020 20:42
Android base activity with auto bind controls to class fields, button click to method etc...
package br.com.vendas;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
@hesenger
hesenger / AutoPersist.cs
Created July 17, 2019 18:41
AutoPersist
public class AutoPersist<T> : IEnumerable<T>
{
private readonly object _lock = new object();
private readonly List<T> _list;
private readonly string _path;
public AutoPersist()
{
_path = FormatPath();
public class OnlyRootContractResolver : CamelCasePropertyNamesContractResolver
{
protected Type _root;
protected List<string> _included;
public OnlyRootContractResolver(Type root, IEnumerable<string> included)
{
_root = root;
_included = new List<string>(included ?? new string[0]);
}
@hesenger
hesenger / parcelar.js
Last active January 12, 2019 11:48
JS - Divide um valor monetário em parcelas iguais, com eventual diferença na primeira parcela.
(function () {
var trunc = function (vl) {
return Math.trunc(vl * 100) / 100;
};
var func = function (valor, parcelas) {
if (parcelas === 1)
return [valor];
var integ = Math.trunc(valor * 100);