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
# Add a trailing slash to a string unless it already ends with one | |
require "benchmark/ips" | |
PATH = "foo/bar".freeze | |
NOOP_PATH = "foo/bar/".freeze | |
def file_join | |
File.join(PATH, "") | |
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
# -*- mode: ruby; indent-tabs-mode: nil; tab-width: 2 -*- | |
# .devcontainer/Gemfile | |
File.expand_path("../Gemfile", __dir__).tap do |gemfile| | |
File.read(gemfile).scan(/^(?:ruby|source|git_source)\s.*/) do |match| | |
instance_eval(match) | |
end | |
end | |
Bundler::LockfileParser.new(Bundler.read_file(File.expand_path("../Gemfile.lock", __dir__))).specs.group_by(&:name).values.each do |specs| |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Test</title> | |
</head> | |
<body> | |
<h2>Output:</h2> | |
<div id="out"></div> |
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
#!/usr/bin/env falcon serve --hybrid -c | |
# frozen_string_literal: true | |
# Adapted from | |
# https://github.com/socketry/falcon/blob/9170a2a59c360945837f5c993e5684bce63b0672/examples/hello/config.ru | |
# | |
# * `gem install falcon` | |
# * This file needs to be named `.ru`, otherwise it won't be loaded as a rackup file. | |
# For a less verbose console |
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 "bundler/inline" | |
gemfile do | |
# eval_gemfile(File.expand_path("../Gemfile", __dir__)) | |
gem "psych", git: "https://github.com/fnordfish/psych.git", branch: "dump-stringify-names" | |
gem "benchmark-ips" | |
gem "benchmark-memory" | |
gem "activesupport" | |
gem "dry-transformer" | |
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
diff --git a/lib/psych/visitors/yaml_tree.rb b/lib/psych/visitors/yaml_tree.rb | |
index 5149178..673c8bc 100644 | |
--- a/lib/psych/visitors/yaml_tree.rb | |
+++ b/lib/psych/visitors/yaml_tree.rb | |
@@ -70,6 +70,7 @@ module Psych | |
fail(ArgumentError, "Invalid line_width #{@line_width}, must be non-negative or -1 for unlimited.") | |
end | |
end | |
+ @stringify_names = options[:stringify_names] | |
@coders = [] |
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
Coercible::Set = Types.Constructor( | |
Set, | |
->(a) { | |
# mock behavior of `Kernel.Array` | |
case a | |
when nil then Set.new | |
when Enumerable then Set.new(a) | |
else Set[a] | |
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
# frozen_string_literal: true | |
# Dead simple static file server using Ruby Rack implementing | |
# Apaches RewriteMap feature using a plain-text mapping file. | |
# See: https://httpd.apache.org/docs/current/rewrite/rewritemap.html#txt | |
# | |
# Deliberately does not use any caching, so keep the size of your redirects.txt | |
# in mind. | |
# | |
# Usage: |
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
VAGRANT_LOG=debug vagrant plugin install --debug vagrant-dns | |
INFO global: Vagrant version: 2.2.19 | |
INFO global: Ruby version: 2.7.4 | |
INFO global: RubyGems version: 3.1.6 | |
INFO global: VAGRANT_LOG="debug" | |
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/embedded/gems/2.2.19/gems/vagrant-2.2.19/bin/vagrant" | |
INFO global: VAGRANT_INSTALLER_VERSION="2" | |
INFO global: VAGRANT_INSTALLER_ENV="1" | |
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/embedded" | |
INFO global: VAGRANT_NO_PLUGINS="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
From 666e8b2ce0a000168ee5de0e5b98147e462dab79 Mon Sep 17 00:00:00 2001 | |
From: Robert Schulze <[email protected]> | |
Date: Tue, 2 Nov 2021 14:38:57 +0100 | |
Subject: [PATCH] --wip-- [skip ci] | |
--- | |
hugolib/paths/paths.go | 5 +++++ | |
hugolib/site.go | 30 +++++++++++++++++++++++++----- | |
hugolib/site_render.go | 8 +++++++- | |
langs/config.go | 2 ++ |
NewerOlder