Skip to content

Instantly share code, notes, and snippets.

@ajvargo
ajvargo / failure_formatter.rb
Created March 1, 2023 15:53
RSpec failure formatter
# It will cycle N dots for progress.
# Failures are printed immediately in detail.
class FailureFormatter
RSpec::Core::Formatters.register self, :example_passed, :example_failed, :dump_summary, :start_dump, :example_pending
@@dot_count = 0
N = 10
attr_reader :output
@ajvargo
ajvargo / failure_formatter.rb
Created December 30, 2021 17:26
Custom RSpec formatter
# I don't like a lot of noise when my specs run.
# This will print the characters from 'progress', but clears the line every 10 so you don't get an epic line of dots.
#
# Any failures are printed as you go, so I can start looking while the the tests finish.
#
# You can simplify this with your .rspec-local file.
# rspec --require path/to/failure_formatter.rb -- format FailureFormatter spec
class FailureFormatter
@ajvargo
ajvargo / looky-loo.el
Created August 5, 2021 15:50
Emacs helper to start aspects of my dev environment.
;;; These commands need to be executed when you are in the context of a nix-project.
;;; Requirements:
;; - direnv (shell and emacs)
;; - projectile (emacs)
(defun av-project-buffer-name-function (proc-name)
"Generate a buffer name based on `PROC-NAME'.
The name looks like '**<nix project> `PROC-NAME'**', **lello overmind**"
`(lambda (_mode-name)
@ajvargo
ajvargo / code-pipeline-watch-mode.el
Last active February 28, 2020 17:55
First solid pass at getting code pipeline work flow updates in emacs.
;;; codepipeline-watch-mode.el --- Watch the progress of AWS Codepipeline Builds -*- lexical-binding: t; -*-
;;; Commentary:
;; Shells out to `aws` command line to get data for display.
;; My theme is dark. No idea how these colors look in a light theme.
;; M-x codepipeline-watch-get-status
;; `g` will refresh - it'll update on its own now and then.
;;; Code:
@ajvargo
ajvargo / rspec-with-nix.el
Created November 22, 2019 17:38
Setup rspec mode so it works with nix and direnv (in emacs)
;;; 0 - install `direnv' on your machine and active it for lello
;;; `cd lello && direnv allow'
;;; 1 - Install `rspec-mode' and configure
;; allows the test finder to not choke on `lib' stuff
(setq rspec-primary-source-dirs '("app"))
@ajvargo
ajvargo / bike.org
Created October 4, 2019 17:06
Thoughts on bike gear

Recommended bike gear

Bike pump

A bikepump is something you want to spend on if you can. It’ll really make a difference. Even on the trainer, should should be putting air in your tires every week or 2. When you start riding outside, you want it a minimum of once a week. Honestly, I’d say make it part of your pre-ride setup.

@ajvargo
ajvargo / auto-complete.org
Created April 22, 2019 17:28
Files for autocomplete talk

Goal

  • Introduce bash completion
  • look at basic options
  • build a custom completion

What’s out there

complete -p
@ajvargo
ajvargo / org-trello.el
Created March 28, 2019 18:06
Extension to allow pulling trello cards into org
;;; the functions of interest are
;;; org-trello-insert-todo
;;; takes the card - like 'JgW7pEMn'
;;; org-trello-insert-todo-from-url
;;; takes a full trello url and pulls the card out
;; For key & token, go to https://trello.com/app-key The key should be
;; front and center. For the token, follow the 'Token' link in the
;; first paragraph and then 'Allow'
(defvar org-trello-key "....")
@ajvargo
ajvargo / ad_refactoring_utils.rb
Created November 7, 2018 19:51
refactoring utils
# config/initializers/ad_refactoring_utils.rb
module Kernel
def print_error_for_debug(e)
puts "E" * 72
puts "-->#{caller.first}"
p e
e.backtrace.delete_if do |l|
l.match('gems').present? ||
l.match('ruby').present?
@ajvargo
ajvargo / trello-todo.el
Created October 1, 2018 18:46
A simple way to pull a card trello cards info into org.
;; For key & token, go to https://trello.com/app-key The key should be
;; front and center. For the token, follow the 'Token' link in the
;; first paragraph and then 'Allow'
;; Just does the title and main contents. pulling in checklists is on my list.
;; inserting assumes you have the bullet point, but not the todo
;; ** <c>