Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile
@cicorias
cicorias / delta.ipynb
Last active January 31, 2025 21:46
Delta Tables in Python with delta-io delta-rs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cicorias
cicorias / #emulate-managed-identity.md
Created January 26, 2025 13:19 — forked from maskati/#emulate-managed-identity.md
Emulate Azure managed identity locally
@cicorias
cicorias / simpleWebHookServer.py
Created January 8, 2025 00:48
Python HTTP server for WebHooks
from http.server import BaseHTTPRequestHandler, HTTPServer
class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def do_OPTIONS(self):
# dump the request pretty
print(f"OPTIONS {self.path} {self.request_version}")
# dump all the request headers
print(f"Request headers:")
for header, value in self.headers.items():
print(f" {header}: {value}")
@cicorias
cicorias / createReactProject.sh
Created January 2, 2025 19:46
script to create a react project in one command courtesy Egghead.io
share-react-project() {
if [[ -z "$1" ]]; then
echo "Usage: share-react-project <project_name>"
return 1
fi
local project_name="$1"
local github_username=$(gh api /user --jq '.login')
echo "Creating Vite project: $project_name"
@cicorias
cicorias / fixghclikey.sh
Created October 31, 2024 14:04
fix github clie keyring issues
# Check for wget, if not installed, install it
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings
# Set keyring path based on existence of /usr/share/keyrings/githubcli-archive-keyring.gpg
# If it is in the old location, use that, otherwise always use the new location.
if [ -f /usr/share/keyrings/githubcli-archive-keyring.gpg ]; then
keyring_path="/usr/share/keyrings/githubcli-archive-keyring.gpg"
else
keyring_path="/etc/apt/keyrings/githubcli-archive-keyring.gpg"
import { Router } from 'next/router';
import { useEffect } from 'react';
import { publicConfig } from '~/shared/config';
import { trpc } from '~/utils/trpc';
let initVersion = publicConfig.GIT_COMMIT;
function useDetectVersionChange() {
const healthQuery = trpc.health.useQuery(undefined, {
refetchInterval: 10_000,
@cicorias
cicorias / c_cpp_properties.json
Created November 27, 2023 18:23 — forked from gyulkkajo/c_cpp_properties.json
IntelliSense config file for Linux kernel X86_64.
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}",
"LINUX_PATH/include",
"LINUX_PATH/include/uapi",
"LINUX_PATH/include/generated",
"LINUX_PATH/arch/x86/include",
@cicorias
cicorias / tmux.rst
Created November 21, 2023 18:34
tmux cheat sheet

TMUX commands

Installation

$ sudo apt-get install tmux
@cicorias
cicorias / django_autoload_registry.py
Created August 14, 2023 08:19 — forked from bruth/django_autoload_registry.py
Registry class that follows a common pattern in Django for autoloading specific modules for a given purpose, e.g. `models.py` and `admin.py`. One such use case enables registering instances or classes and making them available in the admin to associate with some data.
import inspect
from django.conf import settings
from django.utils.importlib import import_module
from django.core.exceptions import ImproperlyConfigured
class AlreadyRegistered(Exception):
pass
@cicorias
cicorias / readme.txt
Created March 16, 2023 22:44 — forked from ANRCorleone/readme.txt
Ubuntu 22.04 + Hyper V + Enhanced Session mode + XRDP PulseAudio
Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
# https://gist.github.com/rkttu/35ecab5604c9ddc356b0af4644d5a226
# Installation and Enhanced session
# follow steps on the post below, I installed Ubuntu 22.04 on a Windows 11 machine