Skip to content

Instantly share code, notes, and snippets.

View schmijos's full-sized avatar

Josua Schmid schmijos

View GitHub Profile
require 'concurrent/array'
Capybara::Session.prepend(Spec::Support::Capybara::Console)
module Spec
module Support
module Capybara
module Console
def driver
@driver ||= super.tap { console.register }
@msebel
msebel / cmailapp-example.php
Last active February 24, 2026 10:52
Sending mail with comotive Mail
<?php
/**
* Very simple PHP class to utilize comotive mail
* @package LBWP\Helper\Mail
*/
class CMailApp
{
/**
* @var string the host uri
@tombruijn
tombruijn / README.md
Last active March 26, 2025 08:03
Retry until fail script

Until fail

Retry a command until it fails.

Debugging brittle specs is annoying and time consuming work. Let's automate finding those brittle specs by retrying them until they fail.

Accompanying blog post.

Usage

@rdnewman
rdnewman / after_rspec_example.rb
Created August 29, 2020 21:18
Rswag support for multiple examples (could eventually be a complementary gem to rswag)
# /spec/support/documentation/after_rspec_example.rb
# Normally, we'd want to break into multiple files, but then it becomes more to install (unless gemified)
module SomeApp
module Documentation
class AfterRspecExample
def self.apply!(context, example, response)
SwaggerExample::Request.apply!(context, example, response)
SwaggerExample::Response.apply!(context, example, response)
end
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@Restuta
Restuta / README.md
Created January 21, 2020 23:49
How to get IP Ranges for Heroku

Ip Ranges

Sometimes it's useful to know what IP ranges our servers are operating in. Since we run on Heroku, it's a little complicated. However, Heroku runs on AWS, which has this page dedicated to IP Ranges by Region.

Heroku recommends using this to identify which region are bing in use. If dynos are run in common spaces in US region, we can look up information about this region using Heroku's API:

using httpie:

 http https://api.heroku.com/regions/us "Accept:application/vnd.heroku+json; version=3"
@coorasse
coorasse / test.rb
Created October 31, 2019 14:53
Preloading issue on Rails 6.0
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
# gem 'rails', '~> 5.2'
@vtno
vtno / config.yml
Last active December 2, 2021 14:50
Circle CI 2.1 templates for deploying Ruby on Rails to Heroku with Ruby 2.6.0 and Node. This config deploys `develop` to staging and `master` to production.
version: 2.1
orbs:
heroku: circleci/heroku@0.0.4
references:
container_setup: &container_setup
docker: # run the steps with Docker
- image: circleci/ruby:2.6.0-rc1-node # ...with this image as the primary container; this is where all `steps` will run
environment: # environment variables for primary container
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active March 16, 2026 01:07
set -e, -u, -o, -x pipefail explanation
@mrmartineau
mrmartineau / stimulus.md
Last active February 6, 2026 16:59
Stimulus cheatsheet