Skip to content

Instantly share code, notes, and snippets.

View eclectic-coding's full-sized avatar
🏠
Working from home

Chuck eclectic-coding

🏠
Working from home
View GitHub Profile
@eclectic-coding
eclectic-coding / sortingAlphabetically.js
Created March 15, 2022 15:22 — forked from Thaekeh/sortingAlphabetically.js
Sort arrays alphabetically
computed: {
sortedArray() {
let sortedRecipes = this.recipes;
sortedRecipes = sortedRecipes.sort((a,b) => {
let fa = a.title.toLowerCase(), fb = b.title.toLowerCase();
if (fa < fb) {
return -1
}
if (fa > fb) {
@eclectic-coding
eclectic-coding / toast_controller.js
Created March 15, 2023 12:03
Show Bootstrap 5 Toast from Stimulus controller
import { Controller } from "@hotwired/stimulus";
import * as bootstrap from "bootstrap";
export default class extends Controller {
connect() {
new bootstrap.Toast(this.element).show();
}
}