Skip to content

Instantly share code, notes, and snippets.

View edoardob90's full-sized avatar

Edoardo Baldi edoardob90

View GitHub Profile

Keybase proof

I hereby claim:

  • I am edoardob90 on github.
  • I am edobld (https://keybase.io/edobld) on keybase.
  • I have a public key ASDPjOLt5-MzzsF_3mAu0zxUuxGZK4nzDVW-yIEQl4G4gAo

To claim this, I am signing this object:

@edoardob90
edoardob90 / longest_substring.py
Created September 8, 2023 12:49
Longest common substring
"""
Longest substring with matrices
"""
def longest_substring(s1: str, s2: str) -> str:
"""Return the longest common substring between s1 and s2"""
s1, s2 = map(str.lower, (s1, s2))
m = [[0] * (1 + len(s2)) for _ in range(1 + len(s1))]
longest, longest_end = 0, 0
for i in range(1, 1 + len(s1)):
@edoardob90
edoardob90 / Dockerfile
Last active October 10, 2023 14:22
LAMMPS Dockerfile
##########################################
# B U I L D T I M E #
##########################################
FROM nvidia/cuda:12.2.0-devel-ubuntu22.04 AS builder
USER root
WORKDIR /root
SHELL ["/bin/bash", "--login", "-c"]
@edoardob90
edoardob90 / app.py
Created October 11, 2023 07:21
Sample Typer CLI
import typer
app = typer.Typer()
state = {"verbose": False}
@app.command()
def create(username: str):
if state["verbose"]:
print("About to create a user")
{loss, path} =
With[{grid = Map[numberParse, makeGrid@ex17, {2}]},
Module[{
goal = Dimensions@grid,
seen = CreateDataStructure["HashSet"],
queue =
CreateDataStructure[
"PriorityQueue", {{0, {1, 1}, {1, 1},
0}}, -Order[First@#1, First@#2] &],
path = CreateDataStructure["HashTable", <|{1, 1} -> {}|>]
#!/bin/bash
iatest=$(expr index "$-" i)
#######################################################
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
#######################################################
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc