Skip to content

Instantly share code, notes, and snippets.

View steveclarke's full-sized avatar

Steve Clarke steveclarke

View GitHub Profile
@steveclarke
steveclarke / linux-setup.sh
Created April 14, 2024 01:09 — forked from dhh/linux-setup.sh
linux-setup.sh
# CLI
sudo apt update -y
sudo apt install -y \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
#/usr/bin/env bash
install_on_ubuntu() {
sudo apt update
sudo apt install -y ansible
}
OS="$(uname -s)"
# Install Ansible by platform
@steveclarke
steveclarke / quasar-grid.sass
Created October 11, 2023 15:46 — forked from yoyosan/quasar-grid.sass
Grid classes for Quasar framework - inspired from Tailwindcss
.grid
display: grid
// Grid template columns
.grid-cols-1
grid-template-columns: repeat(1, minmax(0, 1fr))
.grid-cols-2
grid-template-columns: repeat(2, minmax(0, 1fr))

Steps to Configure Heroku Static

Add Buildpacks

We need to add two buildpacks.

heroku-community/nginx replaces the deprecated heroku-community/static and allows us to configure NGINX to redirect all traffic to dist/spa/index.html (see NGINX Configuration).

#asdf_bin_root=$(dirname $RUBY_VERSION_MANAGER_PATH)
#source "${asdf_bin_root}/../asdf.sh"
#asdf shell ruby $RUBY_VERSION_MANAGER_DISTRIBUTION_ID
# https://youtrack.jetbrains.com/issue/RUBY-27899/Terminal-fails-to-source-chruby.sh-when-using-fish
# https://youtrack.jetbrains.com/issue/RUBY-27517/Terminal-fish-shell-prints-an-error-for-ASDF-startup-script
set asdf_bin_root $(dirname $RUBY_VERSION_MANAGER_PATH)
source $asdf_bin_root/../asdf.fish
asdf shell ruby $RUBY_VERSION_MANAGER_DISTRIBUTION_ID
" https://gist.github.com/steveclarke/ba73c6b2e198f14f1b729ad6825c04ca
" Leader is <space>
let mapleader = ' '
nnoremap <Space> <Nop>
" nobody wants that bell!
set visualbell
set incsearch

Custom Builder for Breadcrumbs on Rails with Bootstrap 5:

# app/lib/bootstrap_five_breadcrumbs.rb
class BootstrapFiveBreadcrumbs < BreadcrumbsOnRails::Breadcrumbs::SimpleBuilder
  def render
    return '' if @elements.size == 0

    @options[:outer_tag] ||= :ol
    @options[:tag] ||= :li
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
margin: 1rem;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
/* https://css-tricks.com/a-grid-of-logos-in-squares/ */
.grid {