Skip to content

Instantly share code, notes, and snippets.

View jdgamble555's full-sized avatar

Jonathan Gamble jdgamble555

View GitHub Profile
@jdgamble555
jdgamble555 / themeselector.js
Last active August 29, 2015 14:21
This code will allow you to initiate a theme changer in your site for jQuery UI.
/*
* Author: Jonathan Gamble
* jQuery UI Theme Changer
*/
$(document).ready(function() {
// id of your theme selector <div>
themeSelector('#themeSelector');
@jdgamble555
jdgamble555 / trigramSearch.ts
Last active February 19, 2021 23:20
Angular Observable for Trigrams Search
// put all of this in a callable angular function
// for searching
// set this.options: Observable<any>
// use that in your template
// get the term from your form control in lowercase
const term = this.myForm.get('term')?.value.toLowerCase();
// set your collection
const col = 'posts';
@jdgamble555
jdgamble555 / fulltext.ts
Last active December 9, 2022 09:30
Firestore Full Text Search Angular
// set your term
// return this.options to your template
// see here: https://fireblog.io/blog/post/firestore-full-text-search
const n: any = term.split(' ').length;
// split words for separate searching...
let newTerm: string[] = term.split(' ');
// add each word to search term
@jdgamble555
jdgamble555 / reference.ts
Created March 29, 2024 20:01
Inner Joins in Firestore
import {
DocumentReference,
type DocumentData,
DocumentSnapshot,
onSnapshot,
Query,
QuerySnapshot,
getDoc,
getDocs
} from 'firebase/firestore';