Skip to content

Instantly share code, notes, and snippets.

View mlaugharn's full-sized avatar
♨️

Marc Laugharn mlaugharn

♨️
View GitHub Profile
@mlaugharn
mlaugharn / gist:963bb19c16a9787d77746851f1c8c631
Created November 18, 2024 10:30
fixed llama 3.2 chat template - supports return_assistant_tokens_mask=True
{{- bos_token }}
{%- if custom_tools is defined %}
{%- set tools = custom_tools %}
{%- endif %}
{%- if not tools_in_user_message is defined %}
{%- set tools_in_user_message = true %}
{%- endif %}
{%- if not date_string is defined %}
{%- if strftime_now is defined %}
{%- set date_string = strftime_now("%d %b %Y") %}
@mlaugharn
mlaugharn / tmux-parallel.sh
Created October 25, 2024 22:35
broadcast commands in parallel to tmux panes
#!/bin/bash
# Usage: ./tmux-parallel.sh "command1" "command2" "command3" ...
# Creates a new tmux window with a pane for each command
if [ $# -eq 0 ]; then
echo "Usage: $0 command1 [command2 ...]"
exit 1
fi
algebraic data types
- adt
- opeltre/fp
typechecking:
- mypy
- dry-python/returns
- life4/deal
typeclasses:
State 2018 Population
California 39776830
Texas 28704330
Florida 21312211
New York 19862512
Pennsylvania 12823989
Illinois 12768320
Ohio 11694664
Georgia 10545138
North Carolina 10390149
@mlaugharn
mlaugharn / .tmux.conf
Last active May 27, 2019 20:45
nice tmux settings
set -g default-shell /usr/bin/zsh
set -g default-command /usr/bin/zsh
set -g default-terminal "screen-256color"
# act like GNU screen
unbind C-b
set -g prefix C-a
set -g base-index 1
set -s escape-time 0
@mlaugharn
mlaugharn / filters.py
Last active August 29, 2015 14:15
port of filters.py project, it was too hackish to warrant a whole repo
# much (some) of this code isn't mine
import PIL.Image, numpy, scipy.misc, scipy.ndimage, scipy.spatial
import time, sys, random, math, functools, collections
# image = PIL.Image.open("4.2.06.tiff") # sailboat on lake
# image = PIL.Image.open("lena.tiff") # lena
pixel_definition = ["r", "g", "b"] # definition of pixel
# neighborhood_kernel = numpy.array([[1, 1, 1],
# [1, 1, 1],