Skip to content

Instantly share code, notes, and snippets.

View rafaelhenrique's full-sized avatar

Rafael Henrique da Silva Correia rafaelhenrique

View GitHub Profile
@Lukas238
Lukas238 / How to generate a PGP Key.md
Last active May 21, 2024 18:46
How to generate a PGP Key
@erdincay
erdincay / sugh.sh
Last active March 14, 2024 21:00
su GitHub (downloading all repositories from a given user)
#!/bin/bash
if [ -z "$1" ]; then
echo "waiting for the following arguments: username + max-page-number"
exit 1
else
name=$1
fi
if [ -z "$2" ]; then
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rg3915
rg3915 / rec_screencast.md
Last active February 23, 2016 14:34
How to record screencast on the Linux with ffmpeg

Install ffmpeg.

$ sudo apt-get install ffmpeg

Run command on terminal or create a rec.sh

ledate=$(date +"%Y%m%d-%H%M%S")
ffmpeg -f x11grab -s 1366x768 -r 25 -i :0.0 -acodec pcm_s16le -f alsa -ac 2 -i pulse ~/desktop_$ledate.mkv

If run rec.sh...

@drgarcia1986
drgarcia1986 / tornado_asyncio.py
Last active August 7, 2021 15:57
Tornado and Asyncio Mixed example
# -*- coding: utf-8 -*-
import asyncio
import re
import asyncio_redis
import tornado.concurrent
import tornado.httpclient
import tornado.web
import tornado.platform.asyncio
@drgarcia1986
drgarcia1986 / dolar_hoje.py
Created June 30, 2015 16:36
Cotação do dólar baseada no site http://dolarhoje.com/
# -*- coding: utf-8 -*-
import urllib.request
import re
resp = urllib.request.urlopen('http://dolarhoje.com/').read()
resp = resp.decode('utf-8')
dolar = re.search(
r'<input type="text" id="nacional" value="(?P<dolar>[^"]+)"/>', resp
)
@drgarcia1986
drgarcia1986 / schools_async.py
Created June 29, 2015 21:59
Escolas, em funcionamento, sem água, energia e esgoto, mostrando alguns detalhes (versão asyncio) (baseado em https://gist.github.com/fmasanori/4d6b7ea38a28681a513a)
import asyncio
import json
import aiohttp
SCHOOL_URL_FMT = 'http://educacao.dadosabertosbr.com/api/escola/{}'
SEARCH_SCHOOL_URL = (
'http://educacao.dadosabertosbr.com/api/escolas/buscaavancada?'
'situacaoFuncionamento=1&energiaInexistente=on&aguaInexistente=on&'
@datagrok
datagrok / README.md
Last active June 6, 2021 14:23
Circular imports in Python 2 and Python 3: when are they fatal? When do they work?
@albrow
albrow / GoSublime.sublime-settings
Last active December 14, 2017 00:12
GoSublime Settings to Run go vet, errcheck, and go install
{
// enable comp-lint, this will effectively disable the live linter
"comp_lint_enabled": true,
// list of commands to run
"comp_lint_commands": [
// run errcheck to catch ignored error return values
{
"cmd": ["errcheck"]
},
@marteinn
marteinn / settings.py
Last active December 27, 2019 17:35
How to use https with S3 + django-storages + boto, with a bucket that contains a dot. (Add this in your settings.py)
AWS_ACCESS_KEY_ID = "YOUR_KEY_ID"
AWS_SECRET_ACCESS_KEY = "YOUR_ACCESS_KEY"
AWS_STORAGE_BUCKET_NAME = "BUCKET-NAME"
AWS_QUERYSTRING_AUTH = False
AWS_S3_SECURE_URLS = True
from boto.s3.connection import OrdinaryCallingFormat, S3Connection
AWS_S3_CALLING_FORMAT = OrdinaryCallingFormat()
S3Connection.DefaultHost = "s3-eu-west-1.amazonaws.com" # Must match your specific region