Instantly share code, notes, and snippets.

View index.html.slim
.logo--floating.mb-g6x
= glyph('logo--icon')
.section.clear
= simple_form_for :search,
url: patients_search_path,
html: @stimulus.controller,
method: :get do |f|
= f.input :q,
View .travis.yml
env:
global:
- PGPORT=5433
language: ruby
rvm:
- 2.5.1
cache:
View USAGE.md

Starting Sidekiq

bundle exec sidekiq -C config/sidekiq.yml

Perform Job Immediately

TestJob.perform_now(user_id: current_user.id)
View control_indicator_helper.rb
# lib/components/control_indicator_helper.rb
module ControlIndicatorComponent
def select_arrow(wrapper_options=nil)
@arrow_icon ||= begin
if options[:arrow_icon].nil? || options[:arrow_icon].to_s == 'default'
''
else
options[:arrow_icon].to_s.html_safe
end
View gist:af1e3c3dba1627451abc8552a5e99baf
def id_number(birthday, gender)
gender = (0..4).to_a.sample if gender == 'female'
gender = (5..9).to_a.sample if gender == 'male'
random_sequence = rand.to_s[2..5]
citizenship = 0
race = 8
id_number = [
birthday.gsub('-', '')[2..-1],
gender,
View 1-README.md

Setup

  • Add a new worker to your Procfile. In this gist I used reporter
  • Add the Heroku Platform gem to your Gemfile
  • Create the HerokuReporterDyno module in lib or any other auto-loadable path
  • Create two jobs. A caller (Reporting::GeneratorJob) and a runner (Reporting::RunnerJob)
  • Deploy
  • Once deployed, log into Heroku and change the newly added reporter dyno to a Performance M or Performance M dyno

How this all works

View hsb-hsl.scss
@function hsb($hue, $saturation, $brightness, $alpha: 1, $hsl-saturation: '') {
@if $brightness == 0 {
@return hsla(0, 0, 0, $alpha);
} @else {
$hsl-lightness: (2 - $saturation / 100) * ($brightness / 2);
$hsl-saturation: ($brightness * $saturation) / if($hsl-lightness < 50, $hsl-lightness * 2, 200 - $hsl-lightness * 2);
@return hsla($hue, $hsl-saturation, $hsl-lightness, $alpha);
}
}
View _helpers.sass
// Create helper classes from $foundation-palette
@each $color, $hex-value in $foundation-palette
.color--#{$color}
color: $hex-value
.color--bg-#{$color}
background-color: $hex-value
// Create helper classes from $header-sizes
@each $size, $headers in $header-sizes
+breakpoint($size)
View svg_glyph.rb
# app/lib/svg_glyph.rb
class SvgGlyph
CURRENT_COLOR = '#383838'
GLYPH_NS = 'glyphs'
GLYPH_PATH = "app/assets/images/#{GLYPH_NS}"
def self.h
ActionController::Base.helpers
View _material-colors.scss
$material-colors-map: (
'red': (
'50': #ffebee,
'100': #ffcdd2,
'200': #ef9a9a,
'300': #e57373,
'400': #ef5350,
'500': #f44336,
'600': #e53935,
'700': #d32f2f,