Skip to content

Instantly share code, notes, and snippets.

import {Controller} from "@hotwired/stimulus"
/*
* PermanentAttribute Controller
*
* This prevents Turbo morphing from updating certain attributes on an element.
* It is especially useful if you have changed a class on the browser in response
* to a UI event without sending this change to the server. The server does not
* know about this change and so will send the browser the original class on morphing,
* thereby clearing the state introduced by the original UI event.
@jmdfm
jmdfm / lsp.lua
Created February 19, 2024 23:42
Setup TailwindCSS LSP in LazyVim to provide completions in Ruby / Phlex components
-- textDocument/diagnostic support until 0.10.0 is released
_timers = {}
local function setup_diagnostics(client, buffer)
if require("vim.lsp.diagnostic")._enable then
return
end
local diagnostic_handler = function()
local params = vim.lsp.util.make_text_document_params(buffer)
client.request("textDocument/diagnostic", { textDocument = params }, function(err, result)
@bashbunni
bashbunni / .zshrc
Created October 27, 2022 21:41
CLI Pomodoro for Mac
# I'll be doing another one for Linux, but this one will give you
# a pop up notification and sound alert (using the built-in sounds for macOS)
# Requires https://github.com/caarlos0/timer to be installed
# Mac setup for pomo
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-appIcon '~/Pictures/pumpkin.png'\
-sound Crystal"
@DaveSanders
DaveSanders / sr_rspec_notes.md
Last active August 10, 2023 19:47
notes for stimulus_reflex + Rspec

Scenario

I want to use Rspec to build feature specs that test SR pages, just like normal web pages.

Therefore, I expect Capybara + Rspec to be able to do things like:

visit login_path
fill_in 'Email', with: user.email
fill_in 'Password', with: user.password + 'BAD'
expect(page).to have_content('That email or password is not correct')
@meg-gutshall
meg-gutshall / readme-template.md
Last active July 10, 2024 23:19
A README.md template I created from a few different resources. It's a work in progress. ;) Please comment below with any suggestions for edits!

Project Title

Description: A few sentences about your project and/or overview that explains what your project is about.

Build Status and Code Style

Build status of continuous integration (travis, appveyor, etc.) and code style (xo, standard etc.). It's common to include status badges here so contributors and prospective end-users can see the status of your project at a glance. Just don't go too crazy or it will look like a mess.

Find status badges at the follow sites: >- Shields.io

@castwide
castwide / rails.rb
Last active October 24, 2024 16:26
Enhance Rails Intellisense in Solargraph
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# You can put this file anywhere in the project, as long as it gets included in
# the workspace maps. It's recommended that you keep it in a standalone file
# instead of pasting it into an existing one.
#
# @!parse
# class ActionController::Base
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active April 7, 2025 16:27
Online Resources For Web Developers (No Downloading)
@baweaver
baweaver / ruby_books.md
Last active April 11, 2025 11:21
A list of books for learning and expanding on your Ruby knowledge.

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

A good introduction to programming in general. Easy on newer programmers.

/* file:///Users/henryhuman/Documents/04_Business/Bootstrap%20Creative/GitHub%20repositories/bootstrap-classes-list/bootstrap4.5.0.html */
.accordion
.active
.alert
.alert-danger
.alert-dark
.alert-dismissible
.alert-heading
.alert-info
@wotupset
wotupset / vivaldi 瀏覽器的內建特殊URL.txt
Last active February 20, 2024 02:52
vivaldi://chrome-urls
List of Vivaldi URLs
vivaldi://accessibility
vivaldi://appcache-internals
vivaldi://apps
vivaldi://blob-internals
vivaldi://bookmarks
vivaldi://cache
vivaldi://chrome
vivaldi://chrome-urls