Skip to content

Instantly share code, notes, and snippets.

View bernardoadc's full-sized avatar
🚀
Escaping the past by embracing the future

Bernardo A. Dal Corno bernardoadc

🚀
Escaping the past by embracing the future
View GitHub Profile
@bernardoadc
bernardoadc / readme.md
Created April 20, 2022 23:54
katastima.js

Katastima.js

Universal store

  • A store should be a simple proxy for a state
  • Default getters and setters + custom
  • Allows dynamic names like 'a.b.c.d.e'
  • Store getters = functions with special/reduced getters
  • Store setters = actions = methods with multiple setters
  • No mutations!
@bernardoadc
bernardoadc / readme.md
Last active April 21, 2022 00:02
Projeto Reposync

Reposync

Features:

  • list your repos across remotes/Git hosts
  • map repos to local folders, see repos not locally synced and local repos without remotes or even folders without git
  • group repos by sync status, git platforms, common base folders, or customized
  • bulk commands for selected repos/groups (clone, pull, push) + determine priority order
  • help see what's keeping from syncing repos (unstaged changes, etc)
  • manage multiple devices: repos vs devices, what device repos are left behind
@bernardoadc
bernardoadc / readme.md
Last active March 25, 2022 20:01
Test strike multiline code with Markdown in github
<div camelCase="attr"><div>
@bernardoadc
bernardoadc / toHtml.js
Last active January 14, 2022 23:28
Object to HTML
function getAttributes (o) {
const ignore = ['tag', 'innerText', 'children']
return Object.keys(o).reduce(function (r, k) {
if (ignore.includes(k)) return r
r += o[k] ? ` ${k}="${o[k] instanceof Array ? o[k].join(' ') : o[k]}"` : ` ${k}`
return r
}, '')
}
function getChildren (o) {
@bernardoadc
bernardoadc / readme.md
Last active March 28, 2022 11:00
Neat Coding Icons Reference

Coding Icons

Commits / Status

🐞 bug

🚀 feature

✔ test ok

@bernardoadc
bernardoadc / action.yml
Last active December 28, 2020 19:26
Esquemas
- name: Compile Mermaid Markdown
uses: neenjaw/compile-mermaid-markdown-action@0.2.4
@bernardoadc
bernardoadc / DV.js
Last active October 30, 2020 18:21
Calculo geral de DVs
function DV (sequencial, incluirOriginalComSep = false, { SeAcimaDez = '0123456789', modulo = 11, mult = 10, restoVsFalta = false, fatores = '98765432' } = {}) {
if (parseInt(sequencial) != Number(sequencial)) throw new Error('Sequencial não é número válido')
sequencial = String(sequencial)
fatores = fatores.repeat(sequencial.length / 8 + 1).slice(-sequencial.length)
const soma = sequencial.split('').reduce(function (s, v, i) {
return (s += Number(v) * Number(fatores[i]))
}, 0)
let resto = (soma * mult) % modulo
@bernardoadc
bernardoadc / if.html.js
Created November 18, 2019 18:22
Simple HTML If eval
// function $$(selector, context) {
// context = context || document;
// var elements = context.querySelectorAll(selector);
// return Array.prototype.slice.call(elements);
// }
let html = $$('html')[0].innerHTML
let result
while (result = /{{#if.+}}[^]+?{{\/if}}/g.exec(html)) {
@bernardoadc
bernardoadc / dotfiles.md
Last active January 5, 2021 18:45
dotfiles & other defaults Sync
@bernardoadc
bernardoadc / configs.gitconfig
Last active October 10, 2023 18:27
GIT Configs
# should not contain [user], [credential] and [include]s
# nor machine/remotes specific stuff
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[branch]
autosetuprebase = always
autosetupmerge = always # com checkout (remoto ou nao) faz tracking do branch