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 / index.js
Created April 1, 2018 01:14 — forked from sergiopvilar/index.js
Script para baixar livros do site http://lelivros.li/
/*
* lelivros
* user/repo
*
* Copyright (c) 2014 Sérgio Vilar
* Licensed under the MIT license.
*/
'use strict';
@requeijaum
requeijaum / uvc_cap.py
Created April 21, 2018 18:51 — forked from gretel/uvc_cap.py
hack to display video stream from usb connected camera (via libuvc, pyuvc, pygame)
# https://gist.github.com/gretel/73fb72ff48db4cfea71a650f4cc72ba7
# based on example at https://github.com/pupil-labs/pyuvc
# install libuvc and pyuvc - see https://github.com/pupil-labs/pyuvc/blob/master/README.md
# install pygame (pip install pygame)
import uvc
import sys
import logging
import pygame
from pygame.locals import *
@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...

@requeijaum
requeijaum / HTTrack.md
Created June 28, 2018 14:32 — forked from tmslnz/HTTrack.md
Nice command line for HTTrack

Commands

httrack example.com -O ./example.com -N100 −%i0 -I0 --max-rate 0 --disable-security-limits --near -v
httrack example.com -O ./example.com-3 -N100 -I0 -N "%p/%n%[month].%t" --max-rate 0 --disable-security-limits --near  -v