This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------------------- | |
# AI-powered Git Commit Function | |
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
# 1) gets the current staged changed diff | |
# 2) sends them to an LLM to write the git commit message | |
# 3) allows you to easily accept, edit, regenerate, cancel | |
# But - just read and edit the code however you like | |
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
gcm() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from typing import ( | |
List, | |
Dict, | |
Callable, | |
Union, | |
) | |
import numpy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import font_manager | |
font_dirs = ['path/to/font/'] | |
font_files = font_manager.findSystemFonts(fontpaths=font_dirs) | |
for font_file in font_files: | |
font_manager.fontManager.addfont(font_file) | |
# set font | |
plt.rcParams['font.family'] = 'Comic Sans' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import click | |
@click.group() | |
@click.pass_context | |
@click.argument('CHALLENGE', type=int) | |
def challenge(ctx, challenge): | |
ctx.obj = challenge | |
@challenge.command() | |
@click.pass_obj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Pool example for smart memory instantiation""" | |
class Reusable: | |
"""Reusable class""" | |
def test(self): | |
"""Test function""" | |
print(f"Using object: {id(self)}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Conditional instantiation""" | |
class Demo: | |
"""Class with conditional instantiation""" | |
def __new__(cls, **kwargs): | |
if kwargs.get("create"): | |
return super(Demo, cls).__new__(cls) | |
return None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import Process | |
from tqdm import tqdm | |
from functools import partial | |
import time | |
def runInParallel(*fns): | |
""" | |
Handle processs in paralell | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: fmm | |
channels: | |
- conda-forge | |
- anaconda | |
dependencies: | |
- python=3.9 | |
- boost-cpp | |
- libgdal=3.2.1 | |
- bzip2 | |
- expat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git clone [email protected]:licit-lab/symuflow-dev.git symuflow | |
cd symuflow | |
git checkout dev | |
conda env create -f conda/env.yaml | |
conda install -c conda-forge cmake -y | |
conda install -c anaconda make -y | |
conda install -c anaconda clangxx_osx-64 -y | |
mkdir build | |
cd build |
NewerOlder