Skip to content

Instantly share code, notes, and snippets.

View jolby's full-sized avatar

Joel Boehland jolby

View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active April 25, 2024 13:26
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@Lovesan
Lovesan / excel-interop.lisp
Created February 22, 2024 21:45
Excel interop using bike library
(eval-when (:compile-toplevel :load-toplevel :execute)
(unless (find-package 'bike)
(ql:quickload 'bike)))
(named-readtables:in-readtable bike:bike-syntax)
(bike:use-namespace 'System)
;; The below is required to overcome internal bike optimizations related to property retrieval,
;; which utilize Type.GetProperty internally, which does not work for COM objects.
;; Note that you should also use bike:reflection-invoke instead of invoke, for the same reasons.
@digikar99
digikar99 / why-coalton-is-a-language.org
Last active November 5, 2023 07:26
An attempt at introducing Coalton to lispers without a background in ML-like languages

Coalton: Why is the interop not easier, and why might it be necessary for Coalton to be an entire language in itself?

If you came here searching for the context in which some reddit comments were written, you might want to check out this previous version of the article.

Several blog posts have been written about Coalton, about how it can be useful and what it brings to the table. However, to me, it hasn’t been clear why Coalton is the way to solve the problems that it does solve. Isn’t a simpler solution possible without making a full embedded language, and giving users the cognitive overhead of thinking about interop between normal lisp and coalton?

I have been thinking about this for a while as one of my pasttimes, and below I’ll summarize the better reasons why coalton might be the way it is. Perhaps, I couldn’t se

@ashgansh
ashgansh / basel.js
Created August 10, 2023 00:40
Auto-generate OpenAPI spec w/ Anthropic Claude from any programming language
const Anthropic = require('@anthropic-ai/sdk');
const path = require('path');
const YAML = require('yaml');
const fs = require('fs');
// Initialize Anthropic SDK
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
});
@Hellisotherpeople
Hellisotherpeople / blog.md
Last active April 14, 2024 21:52
You probably don't know how to do Prompt Engineering, let me educate you.

You probably don't know how to do Prompt Engineering

(This post could also be titled "Features missing from most LLM front-ends that should exist")

Apologies for the snarky title, but there has been a huge amount of discussion around so called "Prompt Engineering" these past few months on all kinds of platforms. Much of it is coming from individuals who are peddling around an awful lot of "Prompting" and very little "Engineering".

Most of these discussions are little more than users finding that writing more creative and complicated prompts can help them solve a task that a more simple prompt was unable to help with. I claim this is not Prompt Engineering. This is not to say that crafting good prompts is not a difficult task, but it does not involve doing any kind of sophisticated modifications to general "template" of a prompt.

Others, who I think do deserve to call themselves "Prompt Engineers" (and an awful lot more than that), have been writing about and utilizing the rich new eco-system

@didmar
didmar / iter_exec.py
Created April 28, 2023 06:47
IterativeAgentExecutor (LangChain)
"""
Modified langchain.agents.AgentExecutor that runs one step at a time. (Based on langchain 0.0.147)
See the example usage in main() at the bottom of this file.
"""
import time
from typing import Dict, Any, List, Union, Tuple, Iterator
from langchain.agents import AgentExecutor, ZeroShotAgent
from langchain.input import get_color_mapping
from langchain.llms.fake import FakeListLLM
@damico
damico / test-rocm.py
Created April 10, 2023 18:54
Script for testing PyTorch support with AMD GPUs using ROCM
import torch, grp, pwd, os, subprocess
devices = []
try:
print("\n\nChecking ROCM support...")
result = subprocess.run(['rocminfo'], stdout=subprocess.PIPE)
cmd_str = result.stdout.decode('utf-8')
cmd_split = cmd_str.split('Agent ')
for part in cmd_split:
item_single = part[0:1]
item_double = part[0:2]
@mayerrobert
mayerrobert / mmult-simd.lisp
Last active July 22, 2023 21:40
Matrix multiplication optimization experiments with SB-SIMD
;;;; Matrix multiplication optimization experiments
;;;
;;; This file contains functions to multiply two matrices written in Common Lisp.
;;;
;;; DISCLAIMER: while this code has some tests it might contains bugs,
;;; I made it to experiment with SBCL's SIMD support.
;;;
;;; All functions use the naive nested loop algorithm which is O(n^3).
;;; This file contains 5 functions with various optimizations
;;; that should be portable Common Lisp and 5 functions that use sbcl's SB-SIMD.
@rksm
rksm / init-org-ai.el
Last active April 18, 2023 10:30
init script for org-ai.el: https://github.com/rksm/org-ai
;; -*- no-byte-compile: t; -*-
;; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;; org-ai-mode
(use-package org-ai
:ensure t
:commands (org-ai-mode
org-ai-global-mode)
:init
@CFiggers
CFiggers / right-click-menu.ahk
Last active February 28, 2024 22:59
Custom Right-click Menus in AutoHotkey
; Tested and working using AutoHotkey v1.1.33.09
; Uppercaseing, Lowercasing, and Title casing highlighted text in any editable window is used as an example.
; Create the popup menu, assign to the variable "CaseMenu" (rename as desired)
Menu, CaseMenu, Add, Title Case, AltMenuHandler
Menu, CaseMenu, Add, Upper Case, AltMenuHandler
Menu, CaseMenu, Add, Lower Case, AltMenuHandler
; Create and add a sub-menu for Links