This file contains hidden or 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
source "https://rubygems.org" | |
gem "streamlined" |
This file contains hidden or 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 ConvertkitFeatures | |
TAG_ID = 0000000 # redacted | |
FORM_ID = 0000000 # redacted | |
def api_secret = ENV.fetch("CONVERTKIT_API") | |
def conn | |
@conn ||= Faraday.new("https://api.convertkit.com/v3") do |f| | |
f.request :json |
This file contains hidden or 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
customElements.define("paywalled-content", class extends HTMLElement { | |
static observedAttributes = ["open"] | |
attributeChangedCallback(name, oldValue, newValue) { | |
if (name === "open" && newValue !== null) { | |
this.shadowRoot.querySelector("slot").removeAttribute("name") | |
} else { | |
this.shadowRoot.querySelector("slot").name = "public" | |
} | |
} |
This file contains hidden or 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 attachShadowRoots(root, callback = null) { | |
const shadowNodes = [] | |
root.querySelectorAll("template[shadowroot]").forEach(template => { | |
const node = template.parentNode | |
shadowNodes.push(node) | |
const mode = template.getAttribute("shadowroot") | |
const shadowRoot = node.attachShadow({ mode }) | |
shadowRoot.appendChild(template.content) | |
template.remove() | |
attachShadowRoots(shadowRoot).forEach(childNode => shadowNodes.push(childNode)) |
This file contains hidden or 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
document.addEventListener("turbo:visit", () => { | |
let main = document.querySelector("main"); | |
if (main.dataset.turboTransition == "false") return; | |
let [movement, scale] = ["-12px", "0.99"]; | |
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) { | |
[movement, scale] = ["-6px", "1"] | |
}; |
This file contains hidden or 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
ytd-expanded-shelf-contents-renderer:has(ytd-thumbnail-overlay-time-status-renderer[overlay-style="SHORTS"]) { | |
opacity: 0.2 | |
} |
This file contains hidden or 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 String | |
def middle_truncate(truncate_length = 30) | |
return self if length <= truncate_length + 2 | |
"#{self[..(truncate_length / 2)]}…#{self[-(truncate_length / 2)..]}" | |
end | |
end | |
puts "Well, this is a very long string and I hope I can see if it will truncate!".middle_truncate |
This file contains hidden or 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
<div class="bg-gradient-to-b from-pink-100 to-purple-200"> | |
<div class="container m-auto px-6 py-20 md:px-12 lg:px-20"> | |
<div class="m-auto text-center lg:w-8/12 xl:w-7/12"> | |
<h2 class="text-2xl text-pink-900 font-bold md:text-4xl">…</h2> | |
</div> | |
<div class="mt-12 m-auto -space-y-4 items-center justify-center md:flex md:space-y-0 md:-space-x-4 xl:w-10/12"> | |
<div class="relative z-10 -mx-4 group md:w-6/12 md:mx-0 lg:w-5/12"> | |
<div aria-hidden="true" class="absolute top-0 w-full h-full rounded-2xl bg-white shadow-xl transition duration-500 group-hover:scale-105 lg:group-hover:scale-110"></div> | |
<div class="relative p-6 space-y-6 lg:p-8"> | |
<h3 class="text-3xl text-gray-700 font-semibold text-center">…</h3> |
This file contains hidden or 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
Object.class_eval do | |
def self.assign(obj, options={}) | |
options.each do |k, v| | |
obj.send("#{k}=", v) | |
end | |
obj | |
end | |
end |
NewerOlder