This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allows you to run a rails test from the CLI with: | |
# | |
# run_test "when x happens then abcd should happen" | |
# | |
# Which turns it into: | |
# rails test --name "/^test_when_x_happens_then_abcd_should_happen$/" | |
# | |
run_test() { | |
# Check if a test description was provided | |
if [ -z "$1" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TelegramMessenger Usage | |
# Replace 'YOUR_BOT_API_TOKEN' and 'CHAT_ID' with your actual bot token and chat ID | |
bot_token = 'your-bot-token' | |
chat_id = 'your-chat-id' | |
# Create an instance of the TelegramMessenger class | |
telegramer = TelegramMessenger.new(bot_token, chat_id) | |
# Create a multi-line string for the message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDailyQuota() { | |
var quotaRemaining = MailApp.getRemainingDailyQuota() | |
console.log("Daily Quota Remaining: " + quotaRemaining); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Image Tool Example</title> | |
<script src="https://cdn.jsdelivr.net/npm/@editorjs/editorjs@latest"></script> | |
<script src="https://cdn.jsdelivr.net/npm/@donnfelker/editor-js-image@latest"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AttachedValidator < ActiveModel::EachValidator | |
# Active Storage validator to ensure that an attachment is attached. | |
# | |
# usage: | |
# validates :upload, attached: true | |
# | |
def validate_each(record, attribute, _value) | |
return if record.send(attribute).attached? | |
errors_options = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hat tip to Kaushik Gopal for some of this | |
# make zsh tab completion fix capitalization errors for directories and files | |
# i don't know if this is required anymore | |
# autoload -Uz compinit && compinit | |
# 0 -- vanilla completion (abc => abc) | |
# 1 -- smart case completion (abc => Abc) | |
# 2 -- word flex completion (abc => A-big-Car) | |
# 3 -- full flex completion (abc => ABraCadabra) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g theme_nerd_fonts yes | |
set -g theme_display_git_stashed_verbose yes | |
set -g theme_display_git_master_branch yes | |
set -g theme_display_git_untracked yes | |
set -g theme_display_git_dirty yes | |
set -g theme_display_virtualenv yes | |
set -Ux EDITOR code --wait | |
rvm default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- File uploads will be disabled for any trix editor in this div --> | |
<div data-controller="registrations"> | |
<!-- Other html elements ... --> | |
<div class="form-group"> | |
<%= form.label :bio, "Bio" %> | |
<!-- File uploads, and the attachment button will be disabled in this rich text (trix) editor --> | |
<%= form.rich_text_area :bio %> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Your Name | |
email = [email protected] | |
[alias] | |
A = add -A | |
a = add | |
aa = add --all | |
ae = add --edit | |
ai = add --interactive | |
amend = commit --amend -C HEAD |
NewerOlder