Skip to content

Instantly share code, notes, and snippets.

@jeremedia
jeremedia / ruby-structured-outputs-v4.rb
Last active September 24, 2024 23:54
Ruby implementation of OpenAI structured outputs
require 'json'
require 'dry-schema'
require 'openai'
require 'ostruct'
module StructuredOutputs
# Schema class for defining JSON schemas
class Schema
MAX_OBJECT_PROPERTIES = 100
MAX_NESTING_DEPTH = 5
@veekaybee
veekaybee / normcore-llm.md
Last active November 15, 2024 12:06
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@simonw
simonw / how-to-upgrade-heroku-postgresql.md
Last active April 29, 2024 05:07
How to upgrade a Heroku PostgreSQL database to a new plan

How to upgrade a Heroku PostgreSQL database to a new plan

I started a project on a Hobby Dev plan (free, limit 10,000 rows), and then later needed to upgrade it to Hobby Basic ($9/month, limit 10,000,000 rows).

After assigning the new database, I had two databases attached to the application. They looked something like this:

  • HEROKU_POSTGRESQL_OLIVE (postgresql-dimensional-3321) Old, free-tier (Hobby Dev) database
@gsamat
gsamat / download.sh
Last active September 29, 2015 17:35
slack private group to channel import
#!/bin/sh
# 0. create a channel you want to import to
# 1. first you get token and channel_id from slack's API page
# 2. then you run the script
# 3. while it is running, you export your team data, delete everything except one channels.json, users.json and one dir for you channel
# 4. then manually (sorry guys) craft json and put it into channel dir
# 5. make zip and upload it to import
# 6. profit
token=
channel_id=
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active August 12, 2024 10:45
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@pathouse
pathouse / README.md
Created July 13, 2014 17:53
Server Logging in Go

Server Event Logging in Go

Inspo

Many thanks to https://github.com/jadekler/git-go-websiteskeleton who got me started in this direction. Jadekler was in turn inspired by https://gist.github.com/cespare/3985516. Ultimately, this implementation has a lot more in common with cespare's. There are a few minor differences. I mainly wrote this one to teach myself exactly what was going on (hence all the comments) and to demonstrate the inclusion of the gorilla/mux framework without using Jadekler's technique of two separate http muxes.

@nk9
nk9 / largestFiles.py
Last active November 7, 2024 10:22
Python script to find the largest files in a git repository.
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python script to find the largest files in a git repository.
# The general method is based on the script in this blog post:
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
#
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
#
@cryptix
cryptix / fotos.go
Created June 15, 2014 16:03
revel image upload example
package controllers
import (
"bytes"
"image"
"image/gif"
"image/jpeg"
"image/png"
"io"
"net/http"
@patrickhammond
patrickhammond / android_instructions.md
Last active October 13, 2024 21:08
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@archfear
archfear / fix_whitespace.rake
Last active December 27, 2015 17:59
Pre-commit hook for git which removes trailing whitespace, converts tabs to spaces and adds a newline to the end of the file if missing.
script_file = File.join(Rails.root, "script", "git_fix_whitespace.sh")
desc "Remove trailing whitespace and convert tabs to spaces"
task :fix_whitespace do
`sh #{script_file} -f`
end
namespace :fix_whitespace do
desc "Installs a git pre-commit hook which removes trailing whitespace and converts tabs to spaces"
task :install, :force do |t, args|