Skip to content

Instantly share code, notes, and snippets.

View natanaeljr's full-sized avatar

Natanael Rabello natanaeljr

View GitHub Profile
@natanaeljr
natanaeljr / GenericMakefile.mk
Last active August 11, 2023 22:43
Simple generic makefile example to start a project quickly. Can: select C or C++ compiler automatically, identify multiple extentions, detect auto-dependencies and compile modified files only, etc. Various modifiable settings.
PROJECT := $(notdir $(CURDIR))
EXCECUTABLE = $(BUILDDIR)/$(PROJECT)
# Directories specification
SRCDIRS := src
INCDIRS := include
BUILDDIR := build
# @note: to add another source extension, add to herer AND make sure to
# write the " $(BUILDDIR)/%.o: %.ext " rule for this extention in order to work
@natanaeljr
natanaeljr / escape_code.h
Last active October 16, 2022 18:53
Some ANSI Escape Codes for controlling a terminal, (CSI - Control Sequence Introducer), originaly made to work with ESP32
#ifndef _ESCAPE_CODE_H_
#define _ESCAPE_CODE_H_
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#define ESC "\033"
#define ESC_CSI ESC "["
@natanaeljr
natanaeljr / MIPS.asm
Last active October 30, 2019 22:07
Simple assembly program for MIPS archtecture made in Mars software. Simples programa em assembly para arquitetura MIPS feito no software Mars. Code: binary to gray, print integer bits, 7seg converter, generic counter, etc.
## Copyright 2017 Natanael Rabello ##
# Syscall codes
.eqv SOUT_INT 1
.eqv SOUT_STR 4
.eqv SIN_INT 5
# Imprimi uma string
.macro print_str(%str)
.data

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@natanaeljr
natanaeljr / travis.yml
Created February 26, 2018 11:55 — forked from tgrrtt/travis.yml
Travis-CI Config File (.travis.yml)
# Set up notification options
notifications:
email:
recipients:
- one@example.com
- other@example.com
# change is when the repo status goes from pass to fail or vice versa
on_success: change
on_failure: always
@natanaeljr
natanaeljr / license-badges.md
Created February 26, 2018 16:29 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.  
  • 🇫🇷 Cette liste en français
  • Github has a new autodetection of the LICENSE file, which shows up the license at the repo overview
@natanaeljr
natanaeljr / git_submodules.md
Created March 12, 2018 16:52 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "driver/gpio.h"
#include "driver/i2c.h"
#include "driver/spi_master.h"
#include "esp_err.h"
#include "esp_log.h"
@natanaeljr
natanaeljr / ble_config.c
Created April 7, 2018 00:16 — forked from heiko-r/ble_config.c
ESP32 BLE GATT server example
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "esp_system.h"
#include "esp_log.h"
#include "bt.h"
#include "bta_api.h"
#include "esp_gap_ble_api.h"
#include "esp_bt_main.h"