Skip to content

Instantly share code, notes, and snippets.

View obie's full-sized avatar
🎧
digital nomad making music

Obie Fernandez obie

🎧
digital nomad making music
View GitHub Profile
<div class="question">
<div class="q-no">42.&nbsp;&nbsp;</div>
<div class="q-text">When the charge is reversed in a neuron during an action potential it is called</div>
<div class="answers">
<div class="answer">
<span class="answer-hole"></span>
<div class="opt">a)</div>
<div class="option">Polarization</div>
</div>
<div class="answer">
@obie
obie / quizizz.css
Created November 1, 2016 15:11
Print Quizizz Stylesheet
div {
font-family: Georgia;
font-size: 10pt;
}
h1 {
font-family: Helvetica;
}
img {
padding: 2em;
}
@obie
obie / application_controller.rb
Created October 5, 2020 05:15
Workaround solution for having to restart Rails server to pickup changes to ViewComponent templates (Rails 6.1)
class ApplicationController < ActionController::Base
after_action :clear_view_component_cache, if: -> { Rails.env.development? }
def clear_view_component_cache
ViewComponent::CompileCache.cache = Set.new
end
end
@obie
obie / _alert.haml
Created October 15, 2020 03:29
Alerts in Reactive Rails style (with Shoelace web components)
%sl-alert.popup-toast{id: id, type: type, open: false, duration: duration, closable: true}
%sl-icon{slot: "icon", name: icon}
- if title.present?
%strong= title
%br
= text
@obie
obie / _search.haml
Created November 5, 2020 01:24
Search Implementation using stimulus, shoelace, and mark.js
.spreadsheet--search.grid.grid-flow-col.grid-cols-auto.gap-0.auto-cols-fr.pl-1.pr-8.hidden{ data: { controller: "spreadsheet--search", action: "toggle-search@window->spreadsheet--search#toggleSearch" }}
.input.col-span-9.p-2
%sl-input.w-full(placeholder="Search" size="small" clearable pill){ data: { target: "spreadsheet--search.input"}}
%sl-icon(name="search" slot="prefix")
%sl-dropdown(slot="suffix" placement="bottom-end" hoist){ data: { target: "spreadsheet--search.dropdown"}}
%sl-button(slot="trigger" caret type="text" size="small"){ data: { target: "spreadsheet--search.trigger"}} Highlight
%sl-menu
%sl-menu-item{ data: { target: "spreadsheet--search.higlight"}, checked: true} Highlight
%sl-menu-item{ data: { target: "spreadsheet--search.filter"}} Filter