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
# This file runs fine in Ruby 2.7.2 and errors out in Ruby 3.0.2 with: | |
# testkwargs.rb:15:in `method_missing': no implicit conversion of Foo into Hash (TypeError) | |
# from testkwargs.rb:31:in `<main>' | |
class Helpers | |
end | |
class Foo | |
def wee(a=1, b:2) | |
puts a |
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
load-rails-env() { | |
if [ -f ".rails_env" ]; then | |
export RAILS_ENV=$(cat .rails_env) | |
else | |
export RAILS_ENV=production | |
fi | |
} | |
add-zsh-hook chpwd load-rails-env |
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
<cable-car href="/cc/cable_car" csrf-token="94IkWdvagUHWPGVkD+VeBFVjGoM0zXAf6tgm6BPU+kEpOj2BTtI6bXJQzEDXGAF+R6Dc1ek7oNouatTMrbUy"> | |
<button | |
onclick="this.closest('cable-car').post(this, {extra: 123})" | |
data-x="1" | |
output="#show-the-things" | |
> | |
Do a thing! | |
</button> | |
<section id="show-the-things"></section> |
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
### The Setup | |
Kernel.define_method(:"`") do |val| | |
val | |
end | |
def const(val) | |
val | |
end |
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 Ruby | |
end | |
def am(input) | |
"am #{input}" | |
end | |
def I(input) | |
"I #{input}" | |
end |
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
<timeline-post post-id="54235" source-id="13" > | |
<sl-card style="margin-bottom: var(--sl-spacing-large)"> | |
<a href="https://appleinsider.com/articles/21/05/11/jamf-acquires-zero-trust-cloud-security-startup-wandera-in-400m-deal?utm_medium=rss" target="_blank" slot="image"><img | |
src="https://photos5.appleinsider.com/gallery/41951-81380-34258-61556-jamf-pro-head-xl-xl.jpg" | |
alt="article thumbnail" | |
class="post-thumbnail" | |
/></a> | |
<h3><a target="_blank" class="link" href="https://appleinsider.com/articles/21/05/11/jamf-acquires-zero-trust-cloud-security-startup-wandera-in-400m-deal?utm_medium=rss">Jamf acquires 'zero trust' cloud security startup Wandera in $400M deal</a></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
module.exports = { | |
minify: false, | |
outputPath: "frontend/styles/funky-utilities.css", | |
breakpoints: { | |
xs: { max: "575px" }, | |
sm: { min: "576px", max: "767px" }, | |
md: { min: "768px", max: "991px" }, | |
lg: { min: "992px", max: "1199px" }, | |
xl: { min: "1200px", max: "1399px" }, | |
xxl: "1400px" |
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
require "json" | |
def execjs(js) | |
IO.popen(["node", "--input-type=module"], "r+") do |pipe| | |
pipe.puts js | |
pipe.close_write | |
pipe.read | |
end | |
end |
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
{ | |
"filewatcher.commands": [ | |
{ | |
"match": "test/test_.*\\.rb", | |
"isAsync": true, | |
"cmd": "/bin/zsh --login -c \"cd ${fileDirname}; cd ..; SKIP_COV=true script/test ${file}\" && echo 'Test run completed.'", | |
"event": "onFileChange" | |
} | |
] | |
} |
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
# Use in Liquid or ERB templates like this: | |
# | |
# Liquid: <img src="{% datauri myimage.png %}"> | |
# ERB: <img src="<%= datauri "myimage.png" %>"> | |
class DatauriBuilder < SiteBuilder | |
def build | |
liquid_tag "datauri", :datauri | |
helper "datauri", :datauri | |
end |