Skip to content

Instantly share code, notes, and snippets.

@Pastor
Pastor / parser.go
Created April 23, 2025 16:25
goParser
package html
import (
"golang.org/x/net/html"
"net/http"
)
type Filter func(tagName string) bool
type Extractor func(node *html.Node) Data
type Data any
@Pastor
Pastor / impl.cxx
Last active September 15, 2024 20:52
Ya numbers
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
#include <set>
struct Context {
std::map<char, int> symbols;
std::set<int> used;
int offset;
@Pastor
Pastor / git-config-http-version.md
Created April 26, 2024 13:54 — forked from daopk/git-config-http-version.md
Fix error : RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
git config --global http.version HTTP/1.1
git config --global http.postBuffer 157286400
@Pastor
Pastor / cgo1.go
Created February 21, 2024 14:15 — forked from tejainece/cgo1.go
Examples of calling C code from Golang
package main
//#include<stdio.h>
//void inC() {
// printf("I am in C code now!\n");
//}
import "C"
import "fmt"
func main() {
@Pastor
Pastor / jwt_fast_api.py
Created April 14, 2023 08:25 — forked from jgontrum/jwt_fast_api.py
JWT & FastAPI
import os
from typing import Dict, List, Optional
import requests
from jose import jwt, jwk
from jose.utils import base64url_decode
JWK = Dict[str, str]
JWKS = Dict[str, List[JWK]]
@Pastor
Pastor / spin.md
Created May 7, 2022 20:23 — forked from hadisfr/spin.md
How to Use SPIN Model Checker

How to Use SPIN

Run Verifier

It's possible to use spin -a src.pml to create pan.[cbhmt] files. Then, it's possible to compile the generated verifier using gcc -o pan pan.c. The compiler verifier could be run by ./pan. spin -run src.pml automates the whole process.

Rerun After Failure

@Pastor
Pastor / msys2-SDL2-Setup.md
Created September 17, 2021 20:37 — forked from thales17/msys2-SDL2-Setup.md
msys2 sdl2 setup

Download and install msys2 64bit

Update msys2

  • Update msys2 64bit after install by running pacman -Syu if pacman needs to be updated you might have to close and reopen the terminal and run pacman -Syu again

Install build tools

  • pacman -S git mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_mixer mingw64/mingw-w64-x86_64-SDL2_image mingw64/mingw-w64-x86_64-SDL2_ttf mingw64/mingw-w64-x86_64-SDL2_net mingw64/mingw-w64-x86_64-cmake make

Compile Hello World

@Pastor
Pastor / KeycloakAdminClientExample.java
Created April 21, 2021 21:15 — forked from thomasdarimont/KeycloakAdminClientExample.java
Using Keycloak Admin Client to create user with roles (Realm and Client level)
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
@Pastor
Pastor / ROS_Kinetic_macOS_High_Sierra.txt
Created April 8, 2021 20:39 — forked from stela/ROS_Kinetic_macOS_High_Sierra.txt
A step by step installation of ROS Kinetic on macOS 10.13.4 High Sierra
# A step by step installation of ROS Kinetic on macOS 10.13.4 High Sierra
# Similar in spirit to https://gist.github.com/lubiluk/361a018b267ca4e3ce10cdc68b17363d but for Kinetic and High Sierra.
#
# Assumptions:
# You already installed:
# homebrew
# XCode 9.3 (or in case you want to build CUDA, use CUDA 9.1 with XCode 9.2)
# Remove any anaconda, conda or similar from your path
# You're not afraid of the command line and can deal with potentially incomplete instructions like this file
#