Skip to content

Instantly share code, notes, and snippets.

#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
const int IDX_ESCOLA_START = 1000;
const int IDX_ESCOLA_END = 2899;
const int TOTAL_ESCOLES = IDX_ESCOLA_END - IDX_ESCOLA_START + 1;
const int NUM_PREFERIDES = 3;
const int MAX_PLACES = 50;
@pauek
pauek / Oauth2.md
Created September 11, 2023 15:13 — forked from mziwisky/Oauth2.md
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

@pauek
pauek / main.dart
Created October 14, 2020 14:01
Código Fuente del vídeo *Indirección* (www.youtube.com/user/paueky)
import 'users.dart';
void main() async {
List users = await getUserList();
print(users);
}
@pauek
pauek / casey_quote.txt
Created March 27, 2017 10:40
Casey Quote
Somebody was saying on the forums a while back that
they felt like the code was too messy and... again I
really wanna stress the fact that I don't really wanna
try to tell people that the way they code is wrong
because, you know, I feel that just leads to a lot of
pedantic arguments that aren't usually constructive...
But what I can say is: nobody, in my mind, _nobody_
should be thinking that this code is "messy". This code
### Keybase proof
I hereby claim:
* I am pauek on github.
* I am pauek (https://keybase.io/pauek) on keybase.
* I have a public key whose fingerprint is FE9E 7842 9FB8 BFB9 4ADC 777D D3D9 1163 68EF 2919
To claim this, I am signing this object:
@pauek
pauek / gist:3798585
Created September 28, 2012 08:12
Self-printing program in Go
package main
import "fmt"
const code = `package main
import "fmt"
const code = %s
# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool for host, linux/arm.
lib9
libbio
libmach
misc/pprof
cmd/addr2line
cmd/cov