Skip to content

Instantly share code, notes, and snippets.

View schmijos's full-sized avatar

Josua Schmid schmijos

View GitHub Profile
@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
@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 May 10, 2024 06:00
set -e, -u, -o, -x pipefail explanation
@mrmartineau
mrmartineau / stimulus.md
Last active April 19, 2024 09:41
Stimulus cheatsheet
@XCompWiz
XCompWiz / google-sheets-colour-preview.js
Last active March 10, 2022 04:22 — forked from Pathoschild/google-sheets-color-preview.js
A Google Sheets script which adds colour preview to cells. When you edit a cell containing a valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to that colour and the font colour will be changed to the inverse colour for readability.
/*
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a
valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to
that colour and the font colour will be changed to the inverse colour for readability.
To use this script in a Google Sheets spreadsheet:
1. go to Tools » Script Editor » Spreadsheet;
2. erase everything in the text editor;
3. change the title to "Set colour preview on edit";
@yatsu
yatsu / rbenv-ruby187-macos.sh
Last active July 13, 2023 19:36
Install ruby-1.8.7 with rbenv on macOS Catalina (10.15)
#!/bin/sh
# 1) Install Xcode 11
# 2) Install command line tools: `xcode-select --install`
# 3) Install HomeBrew
# 4) brew tap cartr/qt4 && brew install cartr/qt4/openssl@1.0 subversion rbenv
# 5) Setup rbenv
# 6) Run this command
PKG_CONFIG_PATH="$(brew --prefix cartr/qt4/openssl@1.0)/lib/pkgconfig" \
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"
@bennyfactor
bennyfactor / Ruby 1.8.7 ree-187 macOS Catalina 10.15.7.sh
Last active February 23, 2023 05:18
How to rebuild old ruby on modern macos, because of course the headers moved and bundler suddenly can't build native extensions any more
# This is based on https://gist.github.com/whitehat101/87c06c29dabfe15f094ec331b77a7c6d and https://solitum.net/openssl-os-x-el-capitan-and-brew/
# I take no responsibility for the damage it may do to any other build system you run.
# Disable system integrity protection before this mess.
# Uninstall everything critical to get back to baseline
rbenv uninstall ree-1.8.7-2012.02