Skip to content

Instantly share code, notes, and snippets.

View rubysolo's full-sized avatar

Solomon White rubysolo

View GitHub Profile
@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
@rubysolo
rubysolo / mix_dep_install.sh
Created January 23, 2018 17:39
Docker mix install helper
#!/bin/sh
# manually download and "install" a given mix dep for non-elixir environment
#
# for example, download phoenix in a frontend build stage to get JS deps
depname=$1
version=$(grep "\"$depname\"" mix.lock | cut -d, -f 3 | sed -e 's/ *"//g')
echo "installing $depname version $version..."
@rubysolo
rubysolo / data.js
Created March 1, 2017 00:07 — forked from NPashaP/data.js
Stacked Density and Quantile Graphs
var dqData=[];
dqData.push({title:'Product Groups',
mean:0.0393,
dP:[
['GROUP01',-0.0435,32937],
['GROUP10',-0.2651,132],
['GROUP11',-0.0694,1164],
['GROUP12',0.0345,17127],
['GROUP13',-0.0288,8858],
['GROUP18',-0.3741,46],