Skip to content

Instantly share code, notes, and snippets.

View jeremedia's full-sized avatar

Jeremy Roush jeremedia

View GitHub Profile
@jeremedia
jeremedia / gist:9774932
Created March 26, 2014 01:00
keybase.md
### Keybase proof
I hereby claim:
* I am jeremedia on github.
* I am jeremedia (https://keybase.io/jeremedia) on keybase.
* I have a public key whose fingerprint is 75D4 498C 44F2 3E9C 515B 6E1B E07E 4FB8 9C9F A947
To claim this, I am signing this object:
// From:https://forum.unity.com/threads/set-asset-as-addressable-through-script.718751/#post-5718025
// Code to make Unity assets "addressable"
// Use this object to manipulate addressables
var settings = AddressableAssetSettingsDefaultObject.Settings;
<VirtualHost *:80>
ServerName your-domain.com
ServerAlias www.your-domain.com
# Redirect HTTP traffic to HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</VirtualHost>
SMITHSONIAN_SUB_PROVIDERS = {
'smithsonian_national_museum_of_natural_history' => [
'NMNHANTHRO', # NMNH - Paleobiology Dept.
'NMNHBIRDS', # NMNH - Vertebrate Zoology - Birds Division
'NMNHBOTANY', # NMNH - Botany Dept.
'NMNHEDUCATION', # NMNH - Education & Outreach
'NMNHENTO', # NMNH - Entomology Dept.
'NMNHFISHES', # NMNH - Vertebrate Zoology - Fishes Division
'NMNHHERPS', # NMNH - Vertebrate Zoology - Herpetology Division
'NMNHINV', # NMNH - Invertebrate Zoology Dept.
@jeremedia
jeremedia / ollama_service.rb
Created July 20, 2023 21:32
Rails Ollama Service Example
class OllamaService
extend Dry::Initializer
option :model, default: proc { "llama2:13b" }
option :prompt, default: proc { "Why do I have fingers?" }
option :url, default: proc { "http://localhost:11434" }
option :temperature, default: proc { 0.7 }
def call
@jeremedia
jeremedia / rmagick_install.txt
Last active September 9, 2024 02:24
How to get rmagick to install when it won't due to ' .pc doesn't exist'
Error when gem install rmagick:
/Users/jeremy/.rvm/gems/ruby-3.2.1/gems/pkg-config-1.5.5/lib/pkg-config.rb:504:in `parse_pc': .pc doesn't exist: <MagickCore>
(PackageConfig::NotFoundError)
Needs path to pkgconfig. Get it with:
brew info imagemagick
...
/opt/homebrew/Cellar/imagemagick/7.1.1-19 (809 files, 31.0MB) *
@jeremedia
jeremedia / load_nvm_in_non_interactive_shells.txt
Created October 30, 2023 17:09
Loading NVM in non-interactive shells
From: https://github.com/koenpunt/capistrano-nvm/issues/25#issuecomment-320825075
Put your NVM source script in your .bashrc which is still evaluated even during an non-interactive SSH session. Just make sure you place the declarations at the top, before the case statement:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# If not running interactively, don't do anything
case $- in
@jeremedia
jeremedia / smithsonian_unit_codes_and_descriptions.json
Created July 23, 2024 15:57
From what I can find this info isn't explicitly provided by the institute. Annoyingly.
{
"AAA": {
"name": "Archives of American Art",
"description": "The Archives of American Art collects and preserves primary sources documenting the history of the visual arts in the United States."
},
"AAG": {
"name": "Anacostia Museum and Center for African American History and Culture",
"description": "Focuses on the history and culture of African Americans and the African diaspora, highlighting community and cultural contributions."
},
"ACAH": {
@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