Skip to content

Instantly share code, notes, and snippets.

View thiagopnts's full-sized avatar
phew

Thiago Pontes thiagopnts

phew
View GitHub Profile
@thiagopnts
thiagopnts / day1-1.rs
Last active December 1, 2021 20:03
Advent of Code 2021
// rustc day1-1.rs && ./day1-1 < input.txt
use std::io::{self, BufRead};
fn main() {
println!(
"{}",
io::stdin()
.lock()
.lines()
.take_while(|line| line.is_ok())
@thiagopnts
thiagopnts / puzzle.py
Last active October 22, 2021 06:17
The 8 puzzle problem implementation in python, using A* with hamming distance + moves as f(x)
# -*- coding: utf-8 -*-
from heapq import heappush, heappop
from random import shuffle
import time
class Solver:
def __init__(self, initial_state=None):
self.initial_state = State(initial_state)
self.goal = range(1, 9)
@thiagopnts
thiagopnts / arm.c
Created January 11, 2016 03:34
turn ACT led on
#define GPIO_BASE 0x20200000UL
#define LED_GPFSEL 4
#define LED_GPFBIT 21
#define LED_GPSET 8
#define LED_GPCLR 11
#define LED_GPIO_BIT 15
volatile unsigned int* gpio;
Eu esqueci de voltar aqui explicando o resto da minha saga no Brasil algumas semanas atrás.
TLDR: Brasileiros que fizeram a declaração de saída definitiva não podem ter conta corrente comum no Brasil. Você precisa de uma CDE (conta de domiciliado no exterior).
My tale:
Fui, telefonei e mandei email pra varios bancos tentando entender melhor como funcionava esse negocio de morar fora e manter dinheiro no Brasil.
Em teoria, brasileiros residentes no exterior (com declaracao de saída) perdem alguns direitos que outros brasileiros têm. Um deles sendo o direito de uma conta corrente tradicional e poupança (eu li em algum lugar que vc tambem nao pode ter financiamentos, mas nao lembro a fonte...)
No entanto, Brasileiros residentes no exterior têm direito a um tipo de conta bancária no Brasil pra que possam enviar dinheiro. Essa conta se chama CDE: conta de domiciliado no exterior.
const direction = this.viewer.camera.getWorldDirection();
const theta = Math.atan2(direction.x, direction.z);
const angle = (theta * 180 / Math.PI + 90) * -1;
this.$compass.style.transform = `rotate(${angle}deg)`;
import { h, Component } from 'preact';
import {connect} from 'preact-redux';
import { bindActionCreators } from 'redux';
import * as actions from './actions';
let ProgressBuffer = ({progress = 0}) => {
let progressBufferStyle = {
position: 'relative',
width: `${progress}%`,
backgroundColor: 'gray',
let MutedVolumeIcon = () => <svg version="1.1" id="facebook" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 20.219 14.182" style="enable-background:new 0 0 20.219 14.182;" xmlSpace="preserve">
<g>
<path fill="currentColor" d="M11.885,10.627V7.186v0.006v-0.02v0.004V3.736l0,0V2.604l0,0V0.182h-1l-4,4h-3c-0.55,0-1,0.449-1,1
v4c0,0.549,0.45,1,1,1h3l4,4h1V11.76l0,0V10.627L11.885,10.627z"/>
</g>
<g>
<defs>
<rect id="SVGID_1_" x="-677.281" y="-349.079" width="1024" height="1024"/>
</defs>
from math import sqrt
from heapq import heappush, heappop, nsmallest
class Point:
def __init__(self, coord, data=None):
self.coord = coord
self.data = data
self.dest = None
General
Complete name : starwars.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 13.3 MiB
Duration : 56s 275ms
Overall bit rate : 1 980 Kbps
Movie name : 870749099641279
Encoded date : UTC 1904-01-01 00:00:00

Keybase proof

I hereby claim:

  • I am thiagopnts on github.
  • I am thiagopontes (https://keybase.io/thiagopontes) on keybase.
  • I have a public key whose fingerprint is E674 3D52 FE13 85C5 D810 148F F074 0B8B 4EF5 BF1B

To claim this, I am signing this object: