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 / 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
@geoffreygarrett
geoffreygarrett / github-repository-dispatch.sh
Created February 18, 2022 09:42
How to create a dispatch on a target repository with bash.
# TODO: replace event_type, token, repo and optional_json.
curl -H "Authorization: token {{ token }}" \
-H 'Accept: application/vnd.github.everest-preview+json' \
"https://api.github.com/repos/{{ owner }}/{{ repo }}/dispatches" \
-d '{"event_type": "{{ event_type }}", "client_payload": {{ optional_json | {} }}}'