Skip to content

Instantly share code, notes, and snippets.

View apainintheneck's full-sized avatar

Kevin apainintheneck

View GitHub Profile
@apainintheneck
apainintheneck / newgem
Created December 15, 2024 19:29
A simple CLI for interactively creating a new gem with `bundler`
#!/usr/bin/env ruby
#
# $ ./newgem example
# Add binary executable? no
# Add code of conduct file? no
# Add MIT license? Yes
# Add native extension? (none)
# Add test library? rspec
# Add linter library? standard
# Add continuous integration config? (none)
@apainintheneck
apainintheneck / gem_url_data.json
Created December 13, 2024 04:26
Check gem metadata git urls. Found that most of them are on Github and the rest on Gitlab for the most part.
{
"homepage_uris": [
"https://github.com/whitequark/parser",
"https://github.com/ammar/regexp_parser",
"https://github.com/premailer/css_parser",
"https://github.com/seattlerb/ruby_parser",
"https://github.com/cotag/http-parser",
"http://lukaszwrobel.pl/blog/math-parser-part-3-implementation",
"https://github.com/ota42y/openapi_parser",
"https://whoisrb.org/",
#!/usr/bin/env ruby
require "json"
require "net/http"
# Example:
# {"wordoftheday"=>
# {"date"=>"2024-12-03",
# "past"=>0,
# "future"=>0,
@apainintheneck
apainintheneck / hyperestraier-requirements-type-error.txt
Created November 25, 2024 02:53
Output of `brew audit --formula hyperestraier --git --skip-style -d -v`
/usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/bin/bundle clean
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading hyperestraier
==> Auditing Formula hyperestraier on os catalina and arch intel
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromPathLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/h/hyperestraier.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading pkg-config
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading qdbm
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading curl
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading pkgconf
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading brotli
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FromNameLoader): loading cmake
@apainintheneck
apainintheneck / cronex
Last active November 2, 2024 20:19
A simple cli wrapper around the `cronex` gem.
#!/usr/bin/env ruby
if ARGV.size != 1
puts "usage: cronex [cron line]"
exit 1
end
require "bundler/inline"
gemfile do
@apainintheneck
apainintheneck / wiki-cli.rb
Created October 22, 2024 06:56
An experiment to create a wiki cli app. The results are not promising.
#!/usr/bin/env ruby
require "net/http"
require "json"
require "bundler/inline"
gemfile do
source 'https://rubygems.org'
gem "addressable"
gem "tty-prompt"
@apainintheneck
apainintheneck / udict
Created October 7, 2024 22:40
Query `urbandictionary.com` at the command line.
#!/usr/bin/env ruby
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "urbandict", "~> 1.1", require: "urbandict"
gem "tty-pager", "~> 0.14", require: "tty-pager"
end
@apainintheneck
apainintheneck / brew_sh_bencharks.txt
Created September 2, 2024 22:29
`brew_sh` benchmarks
~ $ cd (brew --repo)
/u/l/Homebrew (master|✔) $ cd library/homebrew/test
/u/l/H/l/h/test (master|✔) $ git grep -n 'brew_sh "' | awk -F": " '
{
sub("_spec.rb", "", $1)
command = "brew tests --profile=1 --only=" $1
print ">>>>> Command: " command
system(command)
}'
>>>>> Command: brew tests --profile=1 --only=cmd/--caskroom:10
diff --git a/Library/Homebrew/test/formulary_spec.rb b/Library/Homebrew/test/formulary_spec.rb
index 6b53acf40c..d63121af9a 100644
--- a/Library/Homebrew/test/formulary_spec.rb
+++ b/Library/Homebrew/test/formulary_spec.rb
@@ -641,6 +641,42 @@ RSpec.describe Formulary do
# end
# end
end
+
+ context "to a third-party tap" do
@apainintheneck
apainintheneck / docs.yml
Created January 16, 2024 04:30
Generate a documentation website on Github Pages for a Crystal project.
# This action does the following on a push to the `main` branch:
# 1. It generates the docs website with `crystal docs`.
# 2. It bundles that docs folder and pushes it to the `gh-pages` branch.
# 3. It deploys that branch to Github pages.
#
# First time setup:
# - Go into the Github settings and specify that the `gh-pages` branch
# should be deployed on Github pages.
name: Github Pages for Crystal Project