Skip to content

Instantly share code, notes, and snippets.

@CarloNicolini
CarloNicolini / ralign
Created October 23, 2013 12:47
Umeyama algorithm for absolute orientation problem in Python
"""
RALIGN - Rigid alignment of two sets of points in k-dimensional
Euclidean space. Given two sets of points in
correspondence, this function computes the scaling,
rotation, and translation that define the transform TR
that minimizes the sum of squared errors between TR(X)
and its corresponding points in Y. This routine takes
O(n k^3)-time.
Inputs:
@Lewiscowles1986
Lewiscowles1986 / extract_har.py
Last active May 8, 2024 17:00 — forked from kafran/extract_har.py
Python 3 script to extract images from HTTP Archive (HAR) files
import json
import base64
import os
import pathlib
from urllib.parse import urlparse
# list of supported image mime-types
# Special thanks to https://gist.github.com/FurloSK/0477e01024f701db42341fc3223a5d8c
# Special mention, and thanks to MDN
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
@P7h
P7h / tmux_vs_screen.md
Last active May 8, 2024 17:00
tmux vs screen commands

tmux vs. screen commands


Action tmux screen
start a new session tmux
tmux new
tmux new-session
screen
start a new session with a name tmux new -s name screen -S name
re-attach a detached session tmux attach
tmux attach-session
screen -r
re-attach a detached session with a name tmux attach -t name
tmux a -t name
screen -r name
re-attach an attached session (detaching it from elsewhere) tmux attach -dtmux attach-session -d screen -dr
@pickx
pickx / pylance_patcher.rs
Last active May 8, 2024 16:56
Patch Pylance's VSCode check
#!/usr/bin/env -S cargo +nightly -Zscript --quiet
---
[package]
edition = "2021"
[dependencies]
eyre = "0.6.12"
home = "0.5.9"
---
@muff-in
muff-in / resources.md
Last active May 8, 2024 16:56
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources
@mbostock
mbostock / .block
Last active May 8, 2024 16:54 — forked from mbostock/.block
Choropleth
license: gpl-3.0
height: 600
border: no
redirect: https://beta.observablehq.com/@mbostock/d3-choropleth
@RitRa
RitRa / exercise.md
Last active May 8, 2024 16:53 — forked from theRemix/exercise.md
MongoDB Practice

MongoDB Practice

MongoDB Exercise in mongo shell

create database

Connect to a running mongo instance, use a database named mongo_practice. use mongo_practice

Insert Documents

@Mjhane2023
Mjhane2023 / solidity-standard-json-input.json
Created May 8, 2024 16:52 — forked from Mr-Gang/solidity-standard-json-input.json
Sample Solidity Json Input for Etherscan Verification
{
"language": "Solidity",
"sources": {
"contracts/Verified.sol": {
"content": "//SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.18;\r\n\r\ncontract Verified {\r\n string public greet =\r\n \"Increase this counter if you completed this tutorial\";\r\n string public tutorial =\r\n \"https://docs.etherscan.io/contract-verification/multichain-verification\";\r\n\r\n uint256 public verified = 0;\r\n\r\n function completedTutorial() public {\r\n verified += 1;\r\n }\r\n}\r\n"
}
},
"settings": {
"metadata": {
"bytecodeHash": "none"
@wllmsash
wllmsash / assigning-static-ip-addresses-in-wsl2.md
Last active May 8, 2024 16:52
Assigning Static IP Addresses in WSL2

Assigning Static IP Addresses in WSL2

WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".

Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:

@101arrowz
101arrowz / README.md
Last active May 8, 2024 16:51
Download a McGraw Hill Education eTextbook

Download a McGraw Hill Education eTextbook

If you purchase a textbook from McGraw Hill, the website to view it is clunky and only works on some devices. You can't go to specific page numbers, the search is super slow, etc. That's why I wrote this script to download the textbook as an ePub file for your own viewing.

Using this script is 100% legal. McGraw Hill publicly hosts their ebooks online in order for their web client to download it. Moreover, to use it, you must already have purchased the book you would like to download, so it is legally yours to use as you please. However, it IS illegal to use this for piracy purposes. DO NOT DISTRIBUTE ANY TEXTBOOKS YOU DOWNLOAD USING THIS SCRIPT.