Skip to content

Instantly share code, notes, and snippets.

View requeijaum's full-sized avatar

Rafael Requião requeijaum

  • Salvador, BA - Brazil
View GitHub Profile
@requeijaum
requeijaum / Unicode.md
Created April 24, 2018 19:24 — forked from gornostal/Unicode.md
Python 2.7. Unicode Errors Simply Explained

Python 2.7. Unicode Errors Simply Explained

I know I'm late with this article for about 5 years or so, but people are still using Python 2.x, so this subject is relevant I think.

Some facts first:

  • Unicode is an international encoding standard for use with different languages and scripts
  • In python-2.x, there are two types that deal with text.
    1. str is an 8-bit string.
  1. unicode is for strings of unicode code points.
@requeijaum
requeijaum / gpg-import-and-export-instructions.md
Created April 27, 2018 02:10 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@requeijaum
requeijaum / git-feature-workflow.md
Created May 8, 2018 19:19 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

There are many Git workflows out there, I heavily suggest also reading the atlassian.com [Git Workflow][article] article as there is more detail then presented here.

The two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited.

When using Bash in the command line, it leaves a bit to be desired when it comes to awareness of state. I would suggest following these instructions on [setting up GIT Bash autocompletion][git-auto].

Basic branching

When working with a centralized workflow the concepts are simple, master represented the official history and is always deployable. With each now scope of work, aka feature, the developer is to create a new branch. For clarity, make sure to use descriptive names like transaction-fail-message or github-oauth for your branches.

@requeijaum
requeijaum / marvel_characters.sql
Created May 29, 2018 03:08 — forked from pamelafox/marvel_characters.sql
marvel_characters.sql
/* Marvel Heroes and Villains
Based on the website http://marvel.wikia.com/Main_Page
with popularity data from http://observationdeck.io9.com/something-i-found-marvel-character-popularity-poll-cb-1568108064
and power grid data from http://marvel.wikia.com/Power_Grid#Power
Collected by: https://www.khanacademy.org/profile/Mentrasto/
*/
CREATE TABLE marvels (ID INTEGER PRIMARY KEY,
name TEXT,
popularity INTEGER,
@requeijaum
requeijaum / HowtodownloadConsumerIso.txt
Last active April 3, 2023 13:39 — forked from CHEF-KOCH/HowtodownloadConsumerIso.txt
Windows Redstone 4 (1803) - All download links - April Update
1. Open Chrome and search for User-Agent Switcher for Chrome extension, link https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg and select Add to Chrome
2. After the extension is installed/added, click the User-Agent extension and change User-Agent to Safari or Android mode
3. Open this link https://www.microsoft.com/en-us/software-download/windows10ISO
4. You will see the April Update ISO files, select the language and bit what you want, finally you can download it using download manager
5. Done, that's all, the direct link are valid only 24 hours after you created them.
Mirrors are here via adguard:
https://tb.rg-adguard.net/public.php
@requeijaum
requeijaum / ffmpeg-install.md
Last active July 3, 2018 01:15 — forked from florentroques/ffmpeg-install.md
Install FFMPEG with all flags on OS X with HomeBrew

You can find the latest --with-something options in the ruby gem

As of posting, the installation with all options is:

brew install ffmpeg --with-chromaprint --with-fdk-aac --with-libass --with-librsvg --with-libsoxr --with-libssh --with-tesseract --with-libvidstab --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-rtmpdump --with-rubberband --with-sdl2 --with-snappy --with-srt --with-tools --with-webp --with-x265 --with-xz --with-zeromq --with-zimg

As of July 2nd, I am getting some issues...

#include <stdio.h>
int main(){
char telefone[100];
char out[100];
int soma=0, a=0, tamanho=0;
char valido[11] = "-0123456789";
#define DISP_A 2
#define DISP_B 3
#define DISP_C 4
#define DISP_D 5
#define DISP_E 6
#define DISP_F 7
#define DISP_G 8
#define DISP_UNI 12
#define DISP_DEZ 13
//usando código do AVR_GCC, diretamente
#define F_CPU 16000000UL //define a frequência do microcontrolador em 16 MHz
#include <avr/io.h> //definições do componente especificado
#include <util/delay.h> //biblioteca para o uso das rotinas de _delay_
#include <avr/pgmspace.h> //biblioteca para poder gravar dados na memória flash
#define DISP PORTD //define um nome auxiliar para o DISP
#define BTN_MAIS PB0 //define PB0 com o nome de BOTAO