Skip to content

Instantly share code, notes, and snippets.

View tloriato's full-sized avatar

Tiago Loriato tloriato

View GitHub Profile
@Shpigford
Shpigford / .cursorrules
Last active April 25, 2025 01:22
Cursor Rules
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code.
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices.
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning.
- Follow the user’s requirements carefully & to the letter.
@dbeyda
dbeyda / sdec_oauth2.md
Last active May 15, 2019 16:54
SDEC OAuth2 Usage

SDEC OAuth2 Usage Guide

Grant by Authorization Code:

Nesse tipo de autenticação, o client direciona o usuário para uma página do servidor de autenticação, onde o usuário fará login e concederá alguma permissão para o client. Em seguida, o usuário é redirecionado de volta para o domínio do client, por meio de uma URL de callback definida pelo client. Dessa forma, o usuário coloca seu login e senha apenas no servidor de autenticação, de forma que esses dados não passam pelo client em nenhum momento. Para seguir esse processo, usaremos o navegador + Postman.

  1. Com o server rodando, abra o navegador em https://localhost:8000/dialog/authorize?response_type=code&client_id=289a320e-6ea8-11e9-a923-1681be663d3e&redirect_uri=http://www.google.com. Essa URL já está preenchida com o client_id criado no banco, com o response_type desse tipo de autenticação, e com u
@VictorTaelin
VictorTaelin / use_cases.md
Created April 16, 2019 00:00
Cool things / use cases if JavaScript was Formality

This is a non-extensive lists of amazing things that would be possible if we had a software platform (browser, OS, whatever) built on top of a proofgramming language like Formality instead of usual programming languages.

Academic publishing

Textual/PDF-based academic publishing world we live in is shamefully primitive. Because of the way things are done, there is a gap between mathematical discovery and what can be used in practice. It is very laborious to use the results of a paper in real world programs. Example: LRS. The analogy: Papers are textual programs. Abstracts are comments. Theorems are types. Proofs are programs. Citations are imports. Peer reviewing is the type checker. I see a world where every paper is formalized. Where you can "import a paper" in your code.

Faster software development

Specify the code you need in Formality, press a key. First, the computer attempts to write the code for you (Proof Search). If it fails, it attempts to find it in a global repository of code (Foogle);

@VictorTaelin
VictorTaelin / promises.md
Last active January 5, 2025 23:01
promises de novo

(edit: clique aqui para um fork desse texto melhor editado, feito pelo Kewerson Hugo; não vou mexer no original pq deu resultado, e eu gostaria de observar se isso pode ser parcialmente atribuido ao seu estilo)

o pq de funcões assíncronas

funcoes de javascript quase sempre são assincronas. isso acontece porque js lida muito com coisas como http requests, leitura de disco... operacoes que levam muito tempo. imagina se seu programa travasse toda vez que vc fizesse um request http? pra evitar isso, o request é feito em background, o programa continua rodando, e depois o resultado é enviado pra vc num callback

request("www.google.com", function callback(resultado) { ... })
@gluk256
gluk256 / eip-whisper-msg-codes.md
Last active August 26, 2019 03:49
eip-whisper-msg-codes

Preamble

EIP: draft
Title: Whsiper Specification
Author: Vlad Gluhovsky <[email protected]>
Type: Informational
Status: Draft
Created: 2017-05-05

Abstract

module.exports = (function(){
function Book(baseCurrency, token){
var book = {};
book.offers = {};
book.offers[baseCurrency] = [];
book.offers[token] = [];
book.pair = [baseCurrency, token];
return book;
};
function offer(offer, book, debug){
@wkrueger
wkrueger / auth.js
Last active December 25, 2016 05:02
auth
const session = require('express-session')
const express = require('express')
var app = express()
app.use(express.session()) //posteriormente configurar a forma de armazenamento do session
//estou convencionando chamadas de REST dentro do prefixo /api. Ou seja, não é uma página, é um serviço
//sua pagina de login chama isso via um AJAX
app.post('/api/login', (req, res, next) => {
import Data.List
import Data.Char
-- Um amigo meu perguntou como eu resolveria o seguinte problema
-- em Haskell, na vida real: http://i.imgur.com/Sno61vt.jpg
-- Leia ele antes de continuar! Minha resposta é a seguinte:
main = do
inicio <- getTime -- seja `inicio` um tempo lido do console
fim <- getTime -- seja `fim` outro tempo lido do console
@karlgluck
karlgluck / Hash Ladders for Shorter Lamport Signatures.md
Last active May 10, 2025 01:59
I describe a method for making Lamport signatures take up less space. I haven't seen anyone use hash chains this way before, so I think it's pretty cool.

What's this all about?

Digital cryptography! This is a subject I've been interested in since taking a class with Prof. Fred Schneider back in college. Articles pop up on Hacker News fairly often that pique my interest and this technique is the result of one of them.

Specifically, this is about Lamport signatures. There are many signature algorithms (ECDSA and RSA are the most commonly used) but Lamport signatures are unique because they are formed using a hash function. Many cryptographers believe that this makes them resistant to attacks made possible by quantum computers.

How does a Lamport Signature work?