Skip to content

Instantly share code, notes, and snippets.

View insilications's full-sized avatar
🐼

Francisco Boni insilications

🐼
View GitHub Profile
@arshednabeel
arshednabeel / vicsek.py
Last active May 6, 2024 05:22
A minimal implementation of the Vicsek model in ~50 lines of code
import numpy as np
from tqdm import trange
def get_neighbour_matrix(x, L, R):
dx = np.subtract.outer(x[:, 0], x[:, 0])
dy = np.subtract.outer(x[:, 1], x[:, 1])
dx[dx > (L / 2) ** 2] -= (L / 2) ** 2
dy[dy > (L / 2) ** 2] -= (L / 2) ** 2
pair_dist = dx ** 2 + dy ** 2
@pedrogarciafreitas
pedrogarciafreitas / README.md
Last active May 31, 2024 21:51
Script to discover the whole CPF from portaldatransparencia.gov.br

BRUTE FORCE CPF FINDER

The CPF (Cadastro de Pessoas Físicas) is an identification document used in Brazil. It is a unique and individual number assigned to each Brazilian citizen. It is used for identification in various situations, such as opening bank accounts, making purchases, contracting services, among others. To obtain a CPF, it is necessary to register with the Federal Revenue Service.

This script uses one of the main services of the Brazilian federal

@jart
jart / rename-pictures.sh
Created December 12, 2023 15:24
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <jtunney@gmail.com>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
# calculation are based on http://www.esreality.com/index.php?a=post&id=1945096
# assuming windows 10 uses the same calculation as windows 7.
import struct
# set according to your device:
device_dpi = 304 # mouse/touchpad dpi
screen_dpi = 157
sample_point_count = 30
sensitivity_factor = 1.0
# sensitivity factor translation table: (windows slider notches)
@betafcc
betafcc / mypy_operators.py
Created October 14, 2022 18:52
Mypy type-level operators
from __future__ import annotations
from typing import (
Any,
Awaitable,
Callable,
Iterable,
Literal,
Mapping,
ParamSpec,
@yinonburgansky
yinonburgansky / windows-acceleration-function.py
Last active June 8, 2024 04:53
windows acceleration function
# calculation are based on http://www.esreality.com/index.php?a=post&id=1945096
# assuming windows 10 uses the same calculation as windows 7.
# guesses have been made calculation is not accurate
# touchpad users make sure your touchpad is calibrated with `sudo libinput measure touchpad-size`
# import matplotlib.pyplot as plt
import struct
# set according to your device:
xinput_device_id = 13
device_dpi = 1000 # mouse dpi
@JohannesMP
JohannesMP / EnableDiscordDevExperiments.md
Last active June 9, 2024 01:51 — forked from ExordiumX/betaenabler.js
Enabling Discord Dev Experiments on Discord for Windows (2022-02)

Enable Dev Experiments in Discord for Windows

image

This guide shows how to enable dev mode for the Discord desktop application running on Windows (as of February 2022).

This can be used to view beta experiments to try features currently in development that are included but hidden by default in Discord release builds.


@Amanieu
Amanieu / pie_reloc.rs
Created August 25, 2021 00:53
PIE self-relocation in Rust
/// Processes all relocations in the ELF dynamic section
unsafe fn process_pie_relocations(auxv: &mut AuxVec) {
// Locate the PT_DYNAMIC segment in the program headers. If we don't have
// a .dynamic section then it means that we are a static executable and
// don't need any relocations.
let pt_dynamic = auxv
.phdr
.iter()
.filter(|p| p.p_type == linux::PT_DYNAMIC)
.next();
@joanbm
joanbm / nvidia-fix-linux-5.14.patch
Created July 12, 2021 19:03
Tentative fix for NVIDIA 465.31 driver for Linux 5.14-rc1
From f18c541edc5e122b06b0c1e65d0a422f0b8109e7 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Fri, 2 Jul 2021 02:09:58 +0200
Subject: [PATCH] Tentative fix for NVIDIA 465.31 driver for Linux 5.14-rc1
---
common/inc/nv-time.h | 6 ++++++
nvidia-drm/nvidia-drm-drv.c | 4 ++++
2 files changed, 10 insertions(+)