Skip to content

Instantly share code, notes, and snippets.

@DJDANNY123
DJDANNY123 / signing-utils.test.ts
Last active March 27, 2025 17:09
K6 Subtle Webcrypto Jwt Signing, this simple example is for ES256 (ECDSA with the P-256 Elliptic Curve), but the same technique should be applicable with different keys
import {
describe,
expect,
// @ts-expect-error importing from url
} from 'https://jslib.k6.io/k6chaijs/4.3.4.3/index.js';
import { crypto } from 'k6/experimental/webcrypto';
import {
encodeJwt,
printArrayBuffer,
string2ArrayBuffer,
@troopa81
troopa81 / HowtoBuildQGISonWindows.md
Last active December 7, 2024 09:26
My notes on how build QGIS on Windows with OSGEO4W v2

To build with Ninja

Download and install Cygwin : https://www.cygwin.com/setup-x86_64.exe Install it and and install the following packages : flex bison curl git unzip

Download and install last stable release of CMake : https://cmake.org/download/

I think we don't need to install git with Windows installer because we already have it with cygwin but I failed to clone https repo and I don't know which cygwin package a need to install.

@woolpeeker
woolpeeker / draw_matches.py
Last active April 21, 2025 19:07
Python replacement for cv2.drawMatches(), for which there are no Python bindings in a release version.
# drawMatches numpy version
def draw_matches(img1, kp1, img2, kp2, matches, color=None):
"""Draws lines between matching keypoints of two images.
Keypoints not in a matching pair are not drawn.
Places the images side by side in a new image and draws circles
around each keypoint, with line segments connecting matching pairs.
You can tweak the r, thickness, and figsize values as needed.
Args:
img1: An openCV image ndarray in a grayscale or color format.
kp1: ndarray [n1, 2]
@pedrouid
pedrouid / webcrypto-examples.md
Created December 15, 2018 01:07
Web Cryptography API Examples
@brad-anton
brad-anton / requests_connect_over_https.py
Last active June 3, 2024 16:16
This is a creative way to force python requests' module to issue a Proxy CONNECT over HTTPS. Also allows you to define proxy headers and other goodies
"""
requests_connect_over_https.py
@brad_anton
This is a creative way to force python requests' module to issue a Proxy
CONNECT over HTTPS. Also allows you to define proxy headers and other goodies
Warning: This was only tested partially
"""
@vcavallo
vcavallo / notes.md
Last active August 25, 2020 09:01
rails + webpacker + webpack-dev-server + vue + remote dev vps and nginx

Process goes something like this:

bundle update webpacker
rails webpacker:binstubs
yarn upgrade @rails/[email protected] # or 'add' instead of upgrade
yarn upgrade webpack-dev-server@"'3.1.4'  # or 'add' instead of upgrade
yarn add webpack-cli

bundle exec rails webpacker:install # don't do this! the scrpit seems to overwrite the @rails/webpacker version to 3.5.3
@kgjenkins
kgjenkins / readme.md
Last active January 14, 2025 20:26
Labels with callout lines in QGIS

Labels with callout lines in QGIS


UPDATE: As of October 2019, QGIS 3.10 has built-in support for label callout lines!


Callouts, sometimes called leader lines, are lines between labels and features on a map. They are useful when constraints of space force a label to be moved away from the

@bbonamin
bbonamin / Brewfile
Last active November 25, 2024 15:47
Capybara Selenium Webdriver: Headless Chrome (with file downloads!) & Headless Firefox
tap "caskroom/cask"
cask "google-chrome"
cask "firefox"
brew "chromedriver"
brew "geckodriver"
@robingustafsson
robingustafsson / jwt.js
Created October 14, 2017 20:16
Simple JWT example for k6 load testing tool
import crypto from "k6/crypto";
import encoding from "k6/encoding";
const algToHash = {
HS256: "sha256",
HS384: "sha384",
HS512: "sha512"
};
function sign(data, hashAlg, secret) {
@chunter
chunter / pageant-autoload-keys-at-startup.txt
Created June 20, 2017 10:51
Make Pageant autoload keys at startup
To make Pageant automatically run and load keys at startup:
- Find the location of pageant.exe
- Windows key + R to open the 'run' dialog box
- Type: 'shell:startup' in the dialog box
- Create a shortcut to the pageant.exe and put into this startup folder.