Skip to content

Instantly share code, notes, and snippets.

View Blackmagicbox's full-sized avatar
💡
Cooking up the next billion dollar Idea.

Rafael Santos Blackmagicbox

💡
Cooking up the next billion dollar Idea.
  • BlackMagicBox
  • Germany
View GitHub Profile
@Blackmagicbox
Blackmagicbox / .babelrc
Last active October 19, 2020 23:24
boiler plate for basic react app
{
"presets": ["@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-optional-chaining"]
}
@Blackmagicbox
Blackmagicbox / jsArray.go
Created May 26, 2020 00:59
JS array in go
package main
import "fmt"
type Arr struct {
len int32
data map[int32]string
}
func (a Arr) get(i int32) string {
@Blackmagicbox
Blackmagicbox / evenOdd.go
Created April 23, 2020 20:38
Simple evenOdd algorithm example in go
package main
import (
"fmt"
)
func main() {
number := make([]int, 11)
@Blackmagicbox
Blackmagicbox / clean_code.md
Created February 28, 2020 11:05 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@Blackmagicbox
Blackmagicbox / my-first-code-commited-on-github.js
Created November 14, 2019 19:34
This was the first piece of code I commited on github
// JavaScript Document
var dir = location.href.toLowerCase();//-----------------------------------Atribui o caminho da página para a variável dir e converte tudo para caixa baixa
/*
* Quando você chama uma função expressão do tipo: var subElementos = document.getElementById("ID").childNodes;
* é criada uma Array em subElementos e cada childNode é atribuído a uma posição da Array.
* Só que não são atribuídos apenas os objetos <li>, são atribuidos também objetos #text.
* Se você tentar selecionar o href das âncoras dentro desses outros objetos, seu script vai parar e apontar que a propriedade para esse item é "undefined".
* O primeiro node de uma Lista, é um desses Elementos #text. então o índice 0 desse array deve ser evitado, o índice 2 também. e por aí vai.
* Logo só as posições ímpares tem as tags <li> que você precisa manipular.
* Então essa função cria uma outra Array para armazenar apenas os nodes que você quer utilizar.
@Blackmagicbox
Blackmagicbox / settings.json
Last active February 10, 2020 22:10
VS Code config
{
"workbench.iconTheme": "vscode-icons",
"editor.renderWhitespace": "all",
"window.zoomLevel": 0,
"editor.fontSize": 14,
"workbench.activityBar.visible": true,
"workbench.colorTheme": "zacks",
"alignment.chars": {
":": {
"spaceBefore": 0,