Skip to content

Instantly share code, notes, and snippets.

View jcary741's full-sized avatar
πŸ‘Ύ
New challenges

Jay Cary jcary741

πŸ‘Ύ
New challenges
  • Chloris Geospatial
View GitHub Profile
@jcary741
jcary741 / badlenovo.ps1
Last active April 9, 2025 12:41
Removal script for Tobii and Nahimic software on Lenovo Legion 5 devices
# Version: 0.1 (2025-01-18)
# License: MIT, use at your own risk
#
# This script disables the Lenovo-installed "Tobii experience" software and "nahimic" software.
# Tested on a Lenovo Legion Pro 5 (82WM) with Windows 11 24H2.
# Run it with `powershell.exe -noprofile -executionPolicy Bypass -File badlenovo.ps1`
# Following this script, you should be able to uninstall the "Tobii experience" app from the control panel (appwiz.cpl)
#
# After major updates, you may need to re-run this script.
@jcary741
jcary741 / useEffectAsync.js
Created June 13, 2023 15:03
useEffectAsync: a cancellable and async version of the React useEffect hook
import {useEffect} from "react";
/**
* A hook that runs an async function on mount with support for cancellation.
*
* If unmounting before the async function completes, the cleanup function will be called.
* @param fn {function} A function that takes a 'cancelled' function as its only argument.
* @param inputs {array?} An optional array of inputs to pass to useEffect.
* @param cleanup {function?} An optional cleanup function to run on unmount.
*
@Thisisnotdalton
Thisisnotdalton / shared_memory_dataframes.py
Last active October 9, 2022 08:11
Examples of using Python 3.8+ shared_memory for working with pandas DataFrames and geopandas GeoDataFrames.
import pickle
import typing
from multiprocessing.shared_memory import SharedMemory, ShareableList
import numpy as np
import pandas as pd
import geopandas as gpd
def create_shared_memory_of_size(shared_memory_name: str, minimum_size_bytes: int) -> SharedMemory:
@gene1wood
gene1wood / aws-lambda-relative-import-no-known-parent-package.md
Last active February 13, 2025 22:07
Python relative imports in AWS Lambda fail with `attempted relative import with no known parent package`

Python relative imports in AWS Lambda fail with attempted relative import with no known parent package

The Problem

In AWS Lambda if I attempt an explicit relative import like this

.
β”œβ”€β”€ lambda_file.py
└── example.py