Skip to content

Instantly share code, notes, and snippets.

View geoffreygarrett's full-sized avatar
πŸ‡ΊπŸ‡¦

Geoffrey Garrett geoffreygarrett

πŸ‡ΊπŸ‡¦
  • Delft University of Technology
  • Netherlands
View GitHub Profile
@geoffreygarrett
geoffreygarrett / .envrc
Last active January 19, 2025 12:16
Nix DevShell for Leptos with pinned Rust toolchains via Fenix
#!/usr/bin/env bash
# 1. If .rust-channel exists, read it; otherwise default to stable
if [ -f .rust-channel ]; then
RUST_CHANNEL="$(cat .rust-channel)"
else
RUST_CHANNEL="stable"
fi
# 2. Validate the channel; if it's not "nightly", assume stable
@geoffreygarrett
geoffreygarrett / deno_dependency_analyzer.sh
Created June 22, 2024 10:36
This Gawk script parses the output from 'deno info', extracts dependencies along with their sizes, converts all sizes to megabytes (MB), aggregates sizes by unique paths, and lists the top 10 largest dependencies sorted by size in descending order.
#!/usr/bin/env gawk -f
# deno_dependency_analyzer.sh
#
# Description:
# This Gawk script parses the output from 'deno info', extracts dependencies along with their sizes,
# converts all sizes to megabytes (MB), aggregates sizes by unique paths, and lists the top 10 largest
# dependencies sorted by size in descending order.
# Execute 'deno info' with provided import map and script, and process the output with gawk
deno info --import-map "$IMPORT_MAP" "$DENO_SCRIPT" | gawk '
@geoffreygarrett
geoffreygarrett / deno_dependency_analyzer.awk
Created June 22, 2024 10:25
This Gawk script parses the output from 'deno info', extracts dependencies along with their sizes, converts all sizes to megabytes (MB), aggregates sizes by unique paths, and lists the top 10 largest dependencies sorted by size in descending order.
#!/usr/bin/env gawk -f
# deno_dependency_analyzer.awk
#
# Usage:
# deno info --import-map ./import_map.json <your_deno_script>.ts | gawk -f deno_dependency_analyzer.awk
#
# Description:
# This Gawk script parses the output from 'deno info', extracts dependencies along with their sizes,
# converts all sizes to megabytes (MB), aggregates sizes by unique paths, and lists the top 10 largest
# dependencies sorted by size in descending order.
"""
Symbolic, auto differentiated implementation of the STTS in [1]
References:
[1] https://arc.aiaa.org/doi/full/10.2514/1.G003897
"""
import itertools
from sympy import symbols, Matrix, diff, lambdify
import numpy as np
# Compute the 1st-order State Transition Tensor
def dfdx(eom, wrt, at):
u = eom.subs(at).evalf()
m = len(u) if hasattr(u, "__len__") else 1
n = len(wrt)
t2 = np.zeros((m, n))
// include for size_t
#include <Eigen/Core>
#include <tuple>
//#include <unsupported/Eigen/CXX11/Tensor>
//#ifdef ODIN_AUTODIFF
//#define ODIN_CONST
#include <autodiff/forward/dual.hpp>
#include <autodiff/forward/dual/eigen.hpp>
bazel run --tool_tag=ijwb:CLion --curses=no --color=yes --progress_in_terminal_title=no -- //odin/examples:example_autodiff_stts
WARNING: ========================================================
WARNING: || ||
WARNING: || β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— ||
WARNING: || β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— ||
WARNING: || β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• ||
WARNING: || β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— ||
WARNING: || β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ ||
WARNING: || β•šβ•β•β•β•β•β• β•šβ•β•β•β•β•β• β•šβ•β• β•šβ•β• ||
WARNING: || ||
@geoffreygarrett
geoffreygarrett / bazel_build.yml
Created July 3, 2023 17:30
pkg-config-github-actions-windows
- name: Setup PkgConfig (Windows)
if: runner.os == 'Windows'
env:
PKG_CONFIG_ZIP: "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip"
GETTEXT_RUNTIME_ZIP: "http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip"
GLIB_ZIP: "http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip"
run: |
curl -LO "${{ env.PKG_CONFIG_ZIP }}"
7z x pkg-config_0.26-1_win32.zip -oC:\MinGW\bin pkg-config.exe
curl -LO "${{ env.GETTEXT_RUNTIME_ZIP }}"
@geoffreygarrett
geoffreygarrett / scrape_url_for_tables.py
Last active March 30, 2022 09:34
Function to scrape all tables from a URL to a list of pandas DataFrame objects.
"""
Function to scrape all tables from a URL to pandas DataFrame objects. The
default URL is the Wikipedia page for Orbital Launch Systems.
"""
import pandas as pd
import requests
from bs4 import BeautifulSoup as bs