Skip to content

Instantly share code, notes, and snippets.

View rubysolo's full-sized avatar

Solomon White rubysolo

View GitHub Profile
@rubysolo
rubysolo / gist:562dcf9b5994b8e0f3df74f968272dce
Created September 30, 2024 23:38
Debug multiple Cypress matches
cy.document().then(doc => {
let $style = doc.createElement("style");
$style.innerHTML = ".highlighted-element { background-color: yellow; }";
doc.head.appendChild($style);
});
cy.get('SOME-SELECTOR')
.each(($el, index) => {
cy.wrap($el).invoke('addClass', `highlighted-element`);
cy.pause();
@rubysolo
rubysolo / clock.swift
Last active August 10, 2024 00:14 — forked from blackgear/clock.swift
A simple floating clock for OS X
// The MIT License
// Copyright (c) 2018 Daniel
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@rubysolo
rubysolo / debug.rb
Created May 2, 2023 21:19
debug gruntkms errors
envfile = ARGV.first
puts "debugging vars from #{envfile}..."
File.readlines(envfile).each do |line|
if line =~ /kmscrypt/
var, _ = line.split("=")
out = %x(gruntkms decrypt --aws-region $AWS_REGION --ciphertext "#{line}")
if out.start_with?(var)
print "."

Keybase proof

I hereby claim:

  • I am rubysolo on github.
  • I am rubysolo (https://keybase.io/rubysolo) on keybase.
  • I have a public key ASBBeCasDm6kVZomh3PnAdGQYeOJVOeqqINbvglD00so9Ao

To claim this, I am signing this object:

@rubysolo
rubysolo / Phoenix esbuild with Tailwind and Fontawesome
Created October 11, 2021 16:16 — forked from ks2211/Phoenix esbuild with Tailwind and Fontawesome
Phoenix with esbuild, fortawesome, and tailwindcss
Phoenix esbuild with Tailwind+Fontawesome
@rubysolo
rubysolo / terragrunt_light.js
Created December 31, 2020 20:02 — forked from dmattia/terragrunt_light.js
A less verbose terragrunt
/**
* Wrapper around terragrunt to display output succinctly on Atlantis.
*
* Terragrunt is notoriously verbose, which can cause Atlantis to output
* hundreds of comments on single PRs, which can be annoying.
*
* This script will output just the final plan for resources to update on
* successful terragrunt runs, but will output all terragrunt output on
* errors.
*/
class Bad < ActiveRecord::Migration
def change
Post.update_all(active: true) # <-- resolves to Post defined in app/models/post.rb
end
end
@rubysolo
rubysolo / README.md
Created February 15, 2019 18:28
NATS multi-tenant

Running multi-tenant NATS server

Requires NATS 2.x, which is currently unreleased, so must be built from master.

connect to the same queue name under multiple accounts:

session 1:

nats-sub -s nats://quser1:one@$NATS_SERVER:$NATS_PORT 'foo'
@rubysolo
rubysolo / elmnotate.gif
Last active April 5, 2018 19:38
elmnotate animation
elmnotate.gif
class Garden
DEFAULT_STUDENTS = %w(
Alice Bob Charlie David
Eve Fred Ginny Harriet
Ileana Joseph Kincaid Larry
)
def initialize(garden_order, students=DEFAULT_STUDENTS)
@garden_order = garden_order
@students = students.map { |student| student.downcase }.sort