Skip to content

Instantly share code, notes, and snippets.

View dcorking's full-sized avatar

David Corking dcorking

View GitHub Profile
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@yahonda
yahonda / ruby31onrails.md
Last active June 25, 2024 20:26
Ruby 3.1 on Rails

Ruby 3.1 on Rails

Actions required to use Ruby 3.1.0 with Rails

Rails 7.0.Z

  • Rails 7.0.1 is compatible with Ruby 3.1.0.
  • Rails 7.0.1 addes net-smtp, net-imap and net-pop gems as Action Mailbox and Action Mailer dependency, you do not need to add them explicitly in your application Gemfile anymore.
  • thor 1.2.1 has been released. You will not see DidYouMean::SPELL_CHECKERS.merge deprecate warnings anymore.

Rails 6.1.Z

  • Use Rails 6.1.5 to support database.yml with aliases and secrets.yml with aliases.
@stevedodson
stevedodson / README.md
Last active July 18, 2022 14:24
Introduction to supervised machine learning in Elastic webinar - Tuesday, February 25, 2020

Introduction to supervised machine learning in Elastic webinar

Tuesday, February 25, 2020

Wednesday, May 27, 2020 - updated customer_churn.ipynb for version 7.7.0

Monday, November 16, 2020 - updated for version 7.10 and eland 7.10b

Monday, September 20, 2021 - updated customer_churn.ipynb for version 7.14

Monday, February 8, 2022 - updated customer_churn.ipynb for version 8.0

@dcorking
dcorking / authentication_spec.rb
Created January 9, 2020 17:20
testing a doorkeeper token request via a password grant
require 'rails_helper'
RSpec.describe '/oauth/', type: :request do
let(:application) { create(:doorkeeper_application, confidential: false) }
let(:user) { create(:user, email: 'joe@example.com', password: "PASSWORD") }
let(:valid_params) do
{
username: user.email,
password: "PASSWORD",
grant_type: 'password',
@dcorking
dcorking / demo_option_parser.rb
Created December 23, 2019 12:26
lightweight-ish option parsing with Ruby standard library
# run with
# ruby tools/demo-option-parser.rb --skip-download
# or
# bundle exec rails runner tools/demo-option-parser.rb --skip-download
require 'optparse' # not needed for rails runner
skip = nil
p ARGV # ["--skip-download"]
@dcorking
dcorking / footer_helper.rb
Last active November 15, 2019 17:00
year, or range of years with en dash if needed - for example for copyright messages
@dcorking
dcorking / hide-hnq-everywhere.css
Created March 6, 2019 14:48
Hide Hot Network Questions everywhere (to aid concentration)
/* for use as a user style, for example in a browser extension like Stylus for Google Chrome */
#hot-network-questions {
display: none
}
@mrmartineau
mrmartineau / stimulus.md
Last active May 12, 2024 04:35
Stimulus cheatsheet
@Andy-Bell
Andy-Bell / .eslintrc.json
Created December 22, 2017 13:47
My minimal eslint
{
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
2
@brickgale
brickgale / .htaccess
Last active January 28, 2022 16:24
Laravel force https for Heroku
#add this on public/.htaccess for Laravel
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]