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 | |
module ArtifactInterface | |
extend ActiveSupport::Concern | |
extend Interfaceable | |
def key | |
raise NotImplementedError | |
end |
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
// helpers/current_helpers.js | |
// On-demand JavaScript objects from "current" HTML <meta> elements. Example: | |
// | |
// <meta name="current-account-id" content="123"> | |
// <meta name="current-account-subdomain" content="Wizard Lab"> | |
// | |
// >> current.account | |
// => { id: "123", subdomain: "Wizard Lab" } | |
// |
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
# Rails production setup via SQLite3 made durable by https://litestream.io/ | |
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine. | |
# | |
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails | |
# | |
# in production you might want to map /data to somewhere on the host, | |
# but you don't have to! | |
# | |
FROM ruby:3.0.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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true, quiet: true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem "activesupport", "~> 7.0.0", require: false |
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" } | |
# Activate the gem you are reporting the issue against. |
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
/** | |
* Get balanced dash-strokearray and dash-strokeoffset properties for a path of a given length. | |
* @param length The length of the path. | |
* @param strokeWidth The shape's stroke-width property. | |
* @param style The stroke's style: "dashed" or "dotted" (default "dashed"). | |
* @param snap An interval for dashes (e.g. 4 will produce arrays with 4, 8, 16, etc dashes). | |
*/ | |
export function getPerfectDashProps( | |
length: number, |
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
/* | |
ERB template chunk from The Feed's display of emails: | |
<section class="postings postings--feed-style" id="postings" | |
data-controller="pagination" data-pagination-root-margin-value="40px"> | |
<%= render partial: "postings/snippet", collection: @page.records, as: :posting, cached: true %> | |
<%= link_to(spinner_tag, url_for(page: @page.next_param), | |
class: "pagination-link", data: { pagination_target: "nextPageLink", preload: @page.first? }) unless @page.last? %> | |
</section> |
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
# ----------------------------- Gem ----------------------------- | |
module PricingEngine | |
module PricingRepositoryInterface | |
extend T::Sig | |
extend T::Helpers | |
interface! | |
sig { abstract.params(ids: T::Array[Integer]).returns(T::Array[Schema::Variant]) } | |
def variants_by_ids(ids);end |
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
export function reduceToParams(elements) { | |
return elements.reduce((hash, node) => Object.assign(hash, { [node.name]: node.value }), {}) | |
} | |
export function stopEverything(e) { | |
e.preventDefault() | |
e.stopPropagation() | |
e.stopImmediatePropagation() | |
} |
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
This function takes a string that is in Latin-1 (ISO-8859-1), UTF-8, or plain ASCII and returns the string properly encoded as UTF-8. In addition, any Microsoft smart quotes (stupid quotes) are replaced with plain ASCII equivalents. This is useful for reading CSV files or other text files from a web upload and getting to a "known good" state. |
NewerOlder