Skip to content

Instantly share code, notes, and snippets.

View bjpcjp's full-sized avatar
💭
Fully caffeinated for your safety

brian piercy bjpcjp

💭
Fully caffeinated for your safety
View GitHub Profile
Group Benchmark Summary Explanation Link
English MMLU (EM) Measures multi-task learning across diverse knowledge domains to evaluate language models' general academic proficiency. MMLU Benchmark
English MMLU-Redux (EM) A reduced version of MMLU focusing on key topics or subsets of academic questions. No dedicated link available.

The compgen command in Linux is a shell built-in used primarily for generating possible completions for commands, functions, files, or other shell elements. It is part of the Bash shell and is often utilized in scripts for tab-completion or command suggestion mechanisms.

Syntax:

compgen [option] [word]

Key Features:

@bjpcjp
bjpcjp / 10_oneliners.py
Created January 19, 2025 17:47
10 python one-liners (KD nuggets)
# https://www.kdnuggets.com/10-python-one-liners-change-coding-game
# 1. Lambda Functions
price_after_discount = lambda price: price*0.9
# 2. Map Operations on Lists
discounted_prices = list(map(price_after_discount, prices))
@bjpcjp
bjpcjp / d3js-bullet.html
Created February 10, 2024 17:25
D3.js - bullet chart
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: auto;
padding-top: 40px;
position: relative;
width: 800px;
}
@bjpcjp
bjpcjp / shell-best-practices.sh
Last active July 31, 2024 13:12
shell script best practices template
#!/usr/bin/env bash
# source: https://sharats.me/posts/shell-script-best-practices/
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
<svg width="10" height="10">
<rect x="0" y="0" width="10" height="10" fill="blue" />
</svg>
{"status"=>1, "complete"=>1, "list"=>{"3492948982"=>{"item_id"=>"3492948982", "resolved_id"=>"3492948982", "given_url"=>"https://www.practicalecommerce.com/tag/video-tools", "given_title"=>"", "favorite"=>"0", "status"=>"0", "time_added"=>"1638225235", "time_updated"=>"1654562695", "time_read"=>"0", "time_favorited"=>"0", "sort_id"=>0, "resolved_title"=>"Video Tools", "resolved_url"=>"https://www.practicalecommerce.com/tag/video-tools", "excerpt"=>"Video offers merchants a range of ways to engage customers and prospects. Here is a list of new and updated tools from video platforms and social media applications. There are tools for promoting products and producing shoppable videos and as well as for editing, live-streaming, and monetizing.", "is_article"=>"1", "is_index"=>"0", "has_video"=>"0", "has_image"=>"0", "word_count"=>"55", "lang"=>"en", "tags"=>{"ecommerce"=>{"item_id"=>"3492948982", "tag"=>"ecommerce"}, "prodmgmt"=>{"item_id"=>"3492948982", "tag"=>"prodmgmt"}, "tools"=>{"item_id"=>"3492948982", "tag"
@bjpcjp
bjpcjp / trading-investment-metrics.py
Last active July 31, 2024 13:17 — forked from bfan1256/metrics.py
5 Performance Metrics for Trading Algorithms and Investment Portfolios
from blankly import Alpaca, CoinbasePro # supports stocks, crypto, and forex
import numpy as np
from math import sqrt
def cagr(start_value: float, end_value: float, years: int):
return (end_value / start_value) ** (1.0 / years) - 1
def sharpe(account_values: np.array, risk_free_rate, annualize_coefficient):
diff = np.diff(account_values, 1) / account_values[1:] # this gets our pct_return in the array
@bjpcjp
bjpcjp / approximate_nearest_neighbors.py
Created April 1, 2021 19:38
https://scikit-learn.org example - approximate_nearest_neighbors.py
# Author: Tom Dupre la Tour
#
# License: BSD 3 clause
import time
import sys
try:
import annoy
except ImportError:
print("The package 'annoy' is required to run this example.")