Skip to content

Instantly share code, notes, and snippets.

View jeremedia's full-sized avatar

Jeremy Roush jeremedia

View GitHub Profile
@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 / rmagick_install.txt
Last active October 1, 2023 18:18
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 / 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
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.
<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>
// 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;
@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: