Skip to content

Instantly share code, notes, and snippets.

View soderalohastrom's full-sized avatar

Scott Soderstrom soderalohastrom

View GitHub Profile
@soderalohastrom
soderalohastrom / README_MINIMAL_PROMPT_CHAINABLE.md
Created April 30, 2025 07:30 — forked from disler/README_MINIMAL_PROMPT_CHAINABLE.md
Minimal Prompt Chainables - Zero LLM Library Sequential Prompt Chaining & Prompt Fusion

Minimal Prompt Chainables

Sequential prompt chaining in one method with context and output back-referencing.

Files

  • main.py - start here - full example using MinimalChainable from chain.py to build a sequential prompt chain
  • chain.py - contains zero library minimal prompt chain class
  • chain_test.py - tests for chain.py, you can ignore this
  • requirements.py - python requirements

Setup

@soderalohastrom
soderalohastrom / llm_factory.py
Created August 17, 2024 14:03 — forked from daveebbelaar/llm_factory.py
LLM Factory with Instructor
from typing import Any, Dict, List, Type
import instructor
from anthropic import Anthropic
from config.settings import get_settings
from openai import OpenAI
from pydantic import BaseModel, Field
class LLMFactory:
@soderalohastrom
soderalohastrom / index.html
Last active August 29, 2015 14:03 — forked from anonymous/Demo-Flexbox-1.markdown
Flexbox for Locations page
<div class="block1">
<ul class="flex-container">
<li class="flex-item">1</li>
<li class="flex-item">2</li>
<li class="flex-item">3</li>
<li class="flex-item">4</li>
<li class="flex-item">5</li>
</ul>
</div>
@soderalohastrom
soderalohastrom / generate_responsive_gallery.scss
Created June 22, 2014 01:57
Mixin to change gallery container cell widths
@soderalohastrom
soderalohastrom / li_block_gallery.scss
Created June 22, 2014 01:53
Using list elements with negative margins
@soderalohastrom
soderalohastrom / alt_rowMachine.scss
Created June 22, 2014 01:48
Slightly changed rowMachine
* {
box-sizing: border-box;
}
body {
background: #222;
}
@mixin rowMachine($numPerRow, $margin) {
width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow);
@soderalohastrom
soderalohastrom / RowMachine.jade
Created June 22, 2014 01:47
Jade for rowMachine (same as repeating 16 divs)
- for (var x = 1; x < 16; x++)
div.person
img(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/darth-vader.jpg")
h3 Darth
@soderalohastrom
soderalohastrom / rowMachine.scss
Created June 22, 2014 01:42
Create a responsive “gallery” of blocks
* {
box-sizing: border-box;
}
body {
background: #222;
}
@mixin rowMachine($numPerRow, $margin) {
width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow);
@soderalohastrom
soderalohastrom / responsive_breakpoints.scss
Created June 22, 2014 01:26
Simple breakpoint implementation
@mixin breakpoint($point) {
@if $point == large {
@media (min-width: 64.375em) { @content; }
}
@else if $point == medium {
@media (min-width: 50em) { @content; }
}
@else if $point == small {
@media (min-width: 37.5em) { @content; }
}
@soderalohastrom
soderalohastrom / retina_images.scss
Created June 22, 2014 01:24
Include retina scaling for those who have it
@mixin image-2x($image, $width, $height) {
@media (min--moz-device-pixel-ratio: 1.3),
(-o-min-device-pixel-ratio: 2.6/2),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {
/* on retina, use image that's scaled by 2 */
background-image: url($image);
background-size: $width $height;
}