Skip to content

Instantly share code, notes, and snippets.

@danhollick
danhollick / tailwind-css-v4.mdc
Last active July 25, 2025 13:58
Cursor rules file for Tailwind CSS v4.0
// Update globs depending on your framework
---
name: tailwind_v4
description: Guide for using Tailwind CSS v4 instead of v3.x
globs: ["**/*.{js,ts,jsx,tsx,mdx,css}"]
tags:
- tailwind
- css
---
@tarellel
tarellel / default_key_bindings.json
Created July 8, 2024 19:46
Zed Settings and Extensions
[
// Standard macOS bindings
{
"bindings": {
"up": "menu::SelectPrev",
"pageup": "menu::SelectFirst",
"shift-pageup": "menu::SelectFirst",
"ctrl-p": "menu::SelectPrev",
"down": "menu::SelectNext",
"pagedown": "menu::SelectLast",
@dhh
dhh / linux-setup.sh
Last active July 5, 2025 08:52
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@jjb
jjb / file.md
Last active July 17, 2025 15:15
Using Jemalloc 5 with Ruby.md

For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.

Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.

Ubuntu/Debian

FROM ruby:3.1.2-bullseye
RUN apt-get update ; \
@tomgrice
tomgrice / Element UI chalk theme for DaisyUI
Last active July 9, 2022 04:54
This is an approximation/color scheme for ElementUI's default 'chalk' theme. To use with DaisyUI (https://daisyui.com), simply add the following code to the 'config' constant in your tailwindcss.config.[c]js file. This will be periodically updated to get it closer to the real theme but bear in mind, it is an approximation and probably will neve…
/**
GitHub: https://github.com/tomgrice
Reddit: /u/gricey91
Add the 'chalk' property to config.daisyui.themes in tailwindcss.config.[c]js
**/
const config = {
daisyui: {
@stevepolitodesign
stevepolitodesign / example.md
Last active April 15, 2022 21:59
Send secure messages in Rails. Work in progress.
# app/controllers/secret_messages_controller.rb
class SecretMessagesController < ApplicationController
  def create
    @secret_message_form = SecretMessageForm.new(secret_message_form_params)

    if @secret_message_form.valid?
      encrypted_content = encrypt_content(
        seed_phrase: params[:secret_message_form][:seed_phrase],
        password: params[:secret_message_form][:password],
@yahonda
yahonda / ruby31onrails.md
Last active June 8, 2025 17:51
Ruby 3.1 on Rails

Ruby 3.1 on Rails

Actions required to use Ruby 3.1.0 with Rails

Rails 7.0.Z

  • Rails 7.0.1 is compatible with Ruby 3.1.0.
  • Rails 7.0.1 addes net-smtp, net-imap and net-pop gems as Action Mailbox and Action Mailer dependency, you do not need to add them explicitly in your application Gemfile anymore.
  • thor 1.2.1 has been released. You will not see DidYouMean::SPELL_CHECKERS.merge deprecate warnings anymore.

Rails 6.1.Z

  • Use Rails 6.1.5 to support database.yml with aliases and secrets.yml with aliases.
@KonnorRogers
KonnorRogers / flash_component.rb
Last active March 31, 2023 19:20
A view component for using Shoelace alerts
class FlashComponent < ViewComponent::Base
extend Dry::Initializer
# notice, warning, and error can be set by default in redirect_to.
# For additional flashes, you must do flash[:type] = "message"
ICONS = {
primary: "info-circle",
success: "check2-circle",
info: "gear",
warning: "exclamation-triangle",
@KonnorRogers
KonnorRogers / environment.js
Last active July 12, 2024 22:42
ESBuild with Webpacker < 6 in Rails. Bye Babel <3
// DONT FORGET TO `yarn add esbuild-loader` !!!
// config/webpacker/environment.js
const { environment } = require('@rails/webpacker')
const { ESBuildPlugin } = require('esbuild-loader')
const esBuildUse = [
{
loader: require.resolve('esbuild-loader'),
// What you want to compile to, in this case, ES7