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
// app/javascript/trix_auto_list.js | |
/* | |
Turn lines starting with dashes or stars into bullet lists and lines starting with "1. " into numbered lists. | |
Works within nested lists but skips headings, code blocks and pasted text. | |
*/ | |
document.addEventListener("trix-change", function (event) { | |
const editor = event.target.editor | |
const position = editor.getPosition() | |
if ( | |
position < 2 || |
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
// Visit The Stimulus Handbook for more details | |
// https://stimulusjs.org/handbook/introduction | |
// | |
// Example HTML: | |
// <div data-controller="toggle-other"> | |
// <input type="checkbox" value="nope" data-action="toggle-other#toggle" /> | |
// <input type="checkbox" value="yeap" data-action="toggle-other#toggle" data-toggle-other-target="disable focus" /> | |
// <input type="text" name="other" data-toggle-other-target="focus" data-toggle-other-target="enable" /> | |
// </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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
#gem "rails", "6.1" |
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
# To display flash messages inside XHR responses, | |
# place this file in app/controllers/concerns/ | |
# then include it in ApplicationController | |
module RenderFlashNowForXhr | |
extend ActiveSupport::Concern | |
private | |
# Flash messages are not directly available for XHR requests |
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
say_status :font_awesome, "Installing Font Awesome..." | |
run "yarn add @fortawesome/fontawesome-free esbuild-plugin-copy" | |
gsub_file "esbuild.config.js", "const esbuildOptions = {}", <<~JS.strip | |
const path = require("path") | |
const esbuildCopy = require('esbuild-plugin-copy').default | |
/** | |
* @typedef { import("esbuild").BuildOptions } BuildOptions | |
* @type {BuildOptions} |
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
<%= text_area_tag :name, content, data: { controller: 'autogrow', action: 'autogrow#resize' } %> |
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
# frozen_string_literal: true | |
namespace :git do | |
desc 'Check that local changes have been pushed to the origin repository' | |
task :check_if_up_to_date do | |
# skip if no git dir detected | |
git_dir = `git rev-parse --git-dir`.strip | |
next if git_dir.empty? | |
time = fetch(:uptodate_time, 300) |
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
/** | |
* Linear-gradient for transparent corners | |
* Based on http://lea.verou.me/2011/03/beveled-corners-negative-border-radius-with-css3-gradients/ | |
*/ | |
div { | |
width: 100px; | |
padding: 2em 0; | |
margin: 2em auto; | |
background: black; |
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> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Responsive Design Testing</title> | |
<style> | |
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; width: 4100px; } | |
.frame { float: left; margin: 0 20px 20px 0; } | |
small { display: block; color: #888; } | |
h2 { margin: 0 0 5px 0; } |
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> | |
<head> | |
<meta charset="utf-8" /> | |
<title>[Testcase] Replacing loaded pages with AJAX content: duplicate ID problem</title> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" /> | |
<script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script> | |
</head> | |
<body> |