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
/** | |
* Toggles a visual overlay for Phoenix HEEx debug annotations. | |
* | |
* When enabled, this function adds a dashed outline to every HTML element that | |
* has a HEEx annotation comment. When the user hovers over an outlined element, | |
* a tooltip appears showing the formatted component and caller information. | |
* | |
* This version combines an annotation with its preceding '@caller' annotation | |
* into a single tooltip for clarity. | |
* |
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
Alice | |
Billy | |
Cindy | |
David | |
Emily | |
Frank | |
Greta | |
Henry | |
Irene | |
James |
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
Azure | |
Brown | |
Coral | |
Denim | |
Ebony | |
Flame | |
Green | |
Hazel | |
Ivory | |
Jaune |
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
javascript:(function()%7B(function()%20%7B%0A%20%20%20%20let%20elem%20%3D%20document.querySelector('%5Btest-page%5D')%3B%0A%20%20%20%20%0A%20%20%20%20if%20(elem%20%26%26%20elem.getAttribute('test-page'))%20%7B%0A%20%20%20%20%20%20%20%20let%20value%20%3D%20elem.getAttribute('test-page')%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20let%20div%20%3D%20document.createElement('div')%3B%0A%20%20%20%20%20%20%20%20let%20input%20%3D%20document.createElement('input')%3B%0A%20%20%20%20%20%20%20%20input.setAttribute('type'%2C%20'text')%3B%0A%20%20%20%20%20%20%20%20input.setAttribute('value'%2C%20value)%3B%0A%20%20%20%20%20%20%20%20input.setAttribute('size'%2C%2030)%3B%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20div.style.position%20%3D%20'fixed'%3B%0A%20%20%20%20%20%20%20%20div.style.top%20%3D%20'0'%3B%0A%20%20%20%20%20%20%20%20div.style.left%20%3D%20'0'%3B%0A%20%20%20%20%20%20%20%20div.style.background%20%3D%20'rgb(255%2C%20233%2C%200)'%3B%0A%20%20%20%20%20%20%20%20div.style.padding%20%3D%20'10px'%3B% |
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
javascript:(function()%7Bjavascript%3A(function()%20%7B%20%20function%20showTestAttributes()%20%7B%20%20%20%20const%20elements%20%3D%20document.querySelectorAll('*')%3B%20%20elements.forEach(element%20%3D%3E%20%7B%20%20%20%20const%20attributes%20%3D%20Array.from(element.attributes)%3B%20%20%20%20const%20testAttributes%20%3D%20attributes.filter(attr%20%3D%3E%20attr.name.startsWith('test-'))%3B%20%20%20%20testAttributes.forEach(attr%20%3D%3E%20%7B%20%20%20%20%20%20const%20label%20%3D%20document.createElement('span')%3B%20%20%20%20%20%20label.style.cssText%20%3D%20%60%20%20%20%20%20%20%20%20background-color%3A%20rgba(255%2C%20233%2C%200%2C%200.3)%3B%20%20%20%20%20%20%20%20border%3A%201px%20solid%20rgb(0%2C%200%2C%200%2C%200.3)%3B%20%20%20%20%20%20%20%20color%3A%20black%3B%20%20%20%20%20%20%20%20font-family%3A%20monospace%3B%20%20%20%20%20%20%20%20font-size%3A%209px%3B%20%20%20%20%20%20%20%20font-weight%3A%20bold%3B%20%20%20%20%20%20%20%20left%3A%200px%3B%20%20%20%20%20%20%20%20padding%3A%202px%206px%3B%20%20%20% |
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
#!/bin/bash | |
REPO_DIR=$1 | |
SHA=$2 | |
if [ -z "${REPO_DIR}" ] || [ -z "${SHA}" ]; then | |
echo "Steals a commit from another repo to this repo" | |
echo "USAGE: ${0} <source-repo-dir> <sha-to-steal>" | |
exit 1 | |
fi |
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
defmodule Dice do | |
def roll(number_of_dice, number_of_sides \\ nil) do | |
for _roll <- 1..number_of_dice do | |
number_of_sides = number_of_sides || sides() | |
1..number_of_sides |> Enum.random() |> color() |> IO.puts() | |
end | |
end | |
def color(text) do | |
IO.ANSI.color(32) <> to_string(text) <> IO.ANSI.reset() |
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.querySelectorAll(".shortStoryId").forEach(function(oldShortStoryId) { | |
oldShortStoryId.remove(); | |
}); | |
document.querySelectorAll(".story").forEach(function (story) { | |
const storyIdAttr = story.getAttribute("data-id"); | |
const storyId = parseInt(storyIdAttr,10).toString(36); | |
const storyElement = document.createElement("span"); | |
const front = storyId.slice(0, -3); | |
const back = storyId.slice(-3); |
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
... | |
gem 'redcarpet' | |
gem 'rouge' | |
... |
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
def query_param_value(url, query_param) | |
Addressable::URI.parse(url).query_values[query_param] | |
end | |
def add_query_params(url, query_params) | |
Addressable::URI.parse(url).tap do |parsed_url| | |
parsed_url.query_values = parsed_url.query_values.merge query_params | |
end.to_s | |
end |
NewerOlder