Skip to content

Instantly share code, notes, and snippets.

View paulfioravanti's full-sized avatar
⌨️
Soon again I heard a tapping somewhat louder than before.

Paul Fioravanti paulfioravanti

⌨️
Soon again I heard a tapping somewhat louder than before.
View GitHub Profile
@paulfioravanti
paulfioravanti / code_quality_slide_notes.md
Last active December 14, 2015 22:39
Code Quality: Tools & Services presentation slide notes

Slide notes for a presentation on the tools and services I use to try and make me a better Ruby programmer. Originally delivered in person to the Adelaide.rb group on January 8, 2013.

Slides
Screencast

I’d like to talk to you a bit about Code Quality, and the tools and services that I have used to try and increase the quality of my code, and make me a better coder.

# Image source

@paulfioravanti
paulfioravanti / .rspec
Created May 18, 2013 07:52
ActiveRecord spec helper for my Rails 4 Rails Tutorial sample app (https://github.com/paulfioravanti/sample_app_rails_4) Full credit for the idea to Corey Haines (https://gist.github.com/coreyhaines/2068977)
# Append
-I app

Keybase proof

I hereby claim:

  • I am paulfioravanti on github.
  • I am paulfioravanti (https://keybase.io/paulfioravanti) on keybase.
  • I have a public key whose fingerprint is CB56 87E1 B708 2C69 B6E5 2B03 1F98 5491 1AA0 B6D0

To claim this, I am signing this object:

@paulfioravanti
paulfioravanti / presence_validator_test.rb
Created July 2, 2015 12:26
Presence Validator Test
require 'active_record'
require 'rspec'
require 'shoulda-matchers'
class Baz < ActiveRecord::Base
establish_connection(adapter: 'sqlite3', database: ':memory:')
validates_presence_of :foo, unless: :bar
def bar
@paulfioravanti
paulfioravanti / support_yml_erb.rb
Created November 13, 2015 01:00
Enable support of ERB-flavoured YAML files in non-Rails Ruby projects.
require 'erb'
# The Ruby I18n module doesn't allow for ERB-interpolated YAML files
# to be used by default, so adding this method seems to be the least
# intrusive way to be able to do so.
# Method implementation is based off I18n::Backend::Base#load_yml
module I18n
module Backend
module Base
protected
@paulfioravanti
paulfioravanti / elixir-phoenix-heroku-deploy-issue.md
Last active February 16, 2018 01:46
Attempted Heroku deploy of Elixir Phoenix Application

Set up new app for Elixir and Phoenix as per Phoenix Heroku Guide

➜ [phoenix_and_elm (master)]$ heroku create --buildpack "https://github.com/HashNuke/heroku-buildpack-elixir"
Creating app... done, ⬢ evening-bastion-24140
Setting buildpack to https://github.com/HashNuke/heroku-buildpack-elixir... done
https://evening-bastion-24140.herokuapp.com/ | https://git.heroku.com/evening-bastion-24140.git
➜ [phoenix_and_elm (master)]$ heroku buildpacks:add https://github.com/gjaldon/heroku-buildpack-phoenix-static --app evening-bastion-24140
Buildpack added. Next release on evening-bastion-24140 will use:
  1. https://github.com/HashNuke/heroku-buildpack-elixir
@paulfioravanti
paulfioravanti / Request.elm
Last active October 3, 2021 01:44
Example of doing a GraphQL inline fragment in Elm (contactListSpec) against a Union type for paginated objects in Phoenix. Ref: https://github.com/paulfioravanti/phoenix-and-elm/tree/graphql
module ContactList.Request exposing (fetchContactList)
import Contact.Request
import ContactList.Model exposing (ContactList)
import GraphQL.Request.Builder as Builder
exposing
( Document
, NonNull
, ObjectType
, Request
@paulfioravanti
paulfioravanti / Command-T-and-Vim.txt
Last active July 7, 2020 01:18
What to do when brew updates Ruby versions and Command-T won't work on Vim anymore
brew uninstall vim
brew uninstall ruby
# vim will install Ruby as a dependency via homebrew
brew install vim
# Command-T needs to compile against the system Ruby
# and not the one installed via asdf
asdf global ruby system
# cd ~/.vim/bundle/command-t/ruby/command-t/ext/command-t
cd ~/.vim/plugged/command-t/ruby/command-t/ext/command-t
make clean
@paulfioravanti
paulfioravanti / elm-verify-examples-and-elm-test.md
Created March 30, 2018 07:03
Elm test runner that covers elm-verify-examples and elm-test tests

Test Runner for both elm-verify-examples and elm-test

I wanted to have a process that would run elm-verify-examples and then elm-test upon any change in an Elm project's src or tests directories.

A command like elm-verify-examples --elm-test-args="--watch" didn't work for me (it ran elm-verify-examples the first time, but only elm-test on subsequent times, so instead I used just and watchexec to accomplish this:

@paulfioravanti
paulfioravanti / build.txt
Created October 22, 2018 23:42
Result of running `bundle exec jekyll build --trace --verbose` on my Jekyll site
Logging at level: debug
Configuration file: /Users/paul/paulfioravanti.github.io/_config.yml
GitHub Pages: github-pages v192
GitHub Pages: jekyll v3.7.4
Requiring: jekyll-github-metadata
Dotenv not found. Skipping
Requiring: jekyll-seo-tag
Requiring: jekyll-feed
Requiring: jekyll-gist
Requiring: jekyll-include-cache