Skip to content

Instantly share code, notes, and snippets.

@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active April 24, 2025 07:41
"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
// This code is to be used with https://turbo.hotwire.dev. By default Turbo keeps visited pages in its cache
// so that when you visit one of those pages again, Turbo will fetch the copy from cache first and present that to the user, then
// it will fetch the updated page from the server and replace the preview. This makes for a much more responsive navigation
// between pages. We can improve this further with the code in this file. It enables automatic prefetching of a page when you
// hover with the mouse on a link or touch it on a mobile device. There is a delay between the mouseover event and the click
// event, so with this trick the page is already being fetched before the click happens, speeding up also the first
// view of a page not yet in cache. When the page has been prefetched it is then added to Turbo's cache so it's available for
// the next visit during the same session. Turbo's default behavior plus this trick make for much more responsive UIs (non SPA).
@ryenski
ryenski / hello.vue
Last active April 7, 2025 21:28
Stimulus.js + Vue.js
<template>
<div id="app">
<p>{{ message }}</p>
</div>
</template>
<script>
export default {
data: function () {
return {
@andrewprogers
andrewprogers / reactRailsTestSetup.md
Last active June 11, 2024 22:08
Setting up A new React on Rails app with webpacker and full test suite

React on Rails with Test Suite (Karma, Jasmine, Enzyme, PhantomJS)

The steps included here detail the steps I followed to get a new React on Rails app set up, with a focus on testing JS components with Karma / Jasmine / Enzyme. A lot of this was liberally borrowed / modified from the Launch Academy curriculum, but there are some additional steps involved to get everything working with webpacker:

Unless otherwise specified, run the code in the terminal

Install Rails with Webpacker configured for React:

rails new project-name
cd project-name
@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active April 9, 2025 12:42
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@juliarose
juliarose / color.rb
Created August 12, 2015 13:01
Ruby color module - for blending two colors, lightening colors, and darkening colors.
module Color
def self.to_hex(c) # convert decimal to hex
n = c.to_i.to_s(16)
n = '0' + n unless n.length > 1 # 2 characters
n
end
def self.to_dec(c) # convert hex to decimal
c.to_i(16)
end
/**
* Imperavi Redactor Plugin for Embedding Tweets
* for version >= 9.1
*
* https://gist.github.com/jasonbyrne/6e96a907c781e90e0dbf
*
* @author Jason Byrne <[email protected]>
* @version 0.5.1
*
* @forked https://gist.github.com/chekalskiy/7438084
@pmarreck
pmarreck / actionview_helpers_texthelper_autolink_patch.rb
Created June 20, 2012 23:42
A monkeypatch to Rails' ActionView::Helpers::TextHelper (or that class provided by the rails_autolink gem) which causes it to chop up input data in case it's too long to handle
@eduardordm
eduardordm / Ability.rb
Created April 11, 2011 18:03
Ability Class, from ActiveRecord
# encoding: utf-8
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest
user.roles.each do |role|
role.permissions.each do |permission|
if permission.subject_class == 'all'