Skip to content

Instantly share code, notes, and snippets.

@hotovson
hotovson / contemplative-llms.txt
Created January 7, 2025 12:36 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@hotovson
hotovson / jkbms.conf
Created July 31, 2024 11:03 — forked from CallMeFoxie/jkbms.conf
Solar stuff monitoring, WIP stuff
{
"port": "/dev/ttyS2",
"baudrate": 115200,
"timeout": 5,
"batteries": [
{
"battery_id": 1,
"cells": 16,
"gpio_de": 74,
"gpio_re": 75,
@hotovson
hotovson / has_many_attached.rb
Created October 28, 2023 09:00 — forked from fractaledmind/has_many_attached.rb
Vanilla Rails isomorphic attachment validations
# /app/models/concerns/has_many_attached.rb
module HasManyAttached
extend ActiveSupport::Concern
class_methods do
def has_many_attached(name, dependent: :purge_later, service: nil, strict_loading: false, **options)
super(name, dependent: :purge_later, service: nil, strict_loading: false)
if options[:file_types].any?
validate "validate_#{name}_file_types".to_sym
@hotovson
hotovson / fix.md
Created October 10, 2023 06:26 — forked from tusharf5/fix.md
Sourcetree repeatedly asking password fix
  1. go to terminal in your project folder. a. run git config credential.helper store
  2. run git pull
  3. input your username and password
  4. go back to sourceTree and run Fetch or Pull, it does not ask your password again.

OR

You need to update SourceTree config via "Preferences -> Git tab -> Git Version" by select "Use System Git", then everything works well

@hotovson
hotovson / bmp280.py
Created July 26, 2023 07:18 — forked from aallan/bmp280.py
Vindriktning webserver for Raspberry Pi Pico W written in MicroPython
from micropython import const
from ustruct import unpack as unp
# Author David Stenwall (david at stenwall.io)
# See https://github.com/dafvid/micropython-bmp280
# SPDX-License-Identifier: MIT
# Power Modes
BMP280_POWER_SLEEP = const(0)
BMP280_POWER_FORCED = const(1)
@hotovson
hotovson / README.md
Created December 12, 2020 09:22 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@hotovson
hotovson / gist:2b76d00084e305f7a78fb2c0e7433f8f
Created September 30, 2020 16:37 — forked from giannisp/gist:ebaca117ac9e44231421f04e7796d5ca
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install [email protected]
brew unlink [email protected]
brew link postgresql
@hotovson
hotovson / callbacks.rb
Created July 30, 2018 17:15
Callback logging
# With thanks to https://github.com/optoro/activerecord-callback_notification for original inspiration
if Rails.env.development?
module ActiveRecord
module CallbackNotifications
extend ActiveSupport::Concern
module ClassMethods
def notify_all_callbacks
# Make sure all models are loaded before trying to enumerate
@hotovson
hotovson / ssl_puma.sh
Created March 29, 2018 12:11 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@hotovson
hotovson / model_json.rb
Created March 27, 2018 13:36 — forked from danielevans/model_json.rb
Converting Serialized YAML to Serialized JSON in Rails models
class Medium < ActiveRecord::Base
serialize :payload, JSON
end