Skip to content

Instantly share code, notes, and snippets.

Jami Gibbs jamigibbs

Block or report user

Report or block jamigibbs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View getPageRef.js
import { LightningElement, wire } from 'lwc';
import { CurrentPageReference } from 'lightning/navigation';
export default class PageRefDemo extends LightningElement {
const pageRefObj = JSON.stringify(this.currentPageReference, null, 4);
jamigibbs / utils.js
Last active Dec 9, 2019
LWC Utils Collection
View utils.js
import checkPermission from '@salesforce/apex/PermissionService.checkPermission'; //
const hasPermission = async (apiName) => {
const response = await checkPermission({ apiName: apiName });
return response;
// Straight from component library playground
const fetchFakeDataHelper = async ({ amountOfRecords }) => {
const recordMetadata = {
View serviceworker.js
"use strict";
/* A version number is useful when updating the worker logic,
allowing you to remove outdated cache entries during the update.
var version = 'v1::';
/* These resources will be downloaded and cached by the service worker
during the installation process. If any resource fails to be downloaded,
then the service worker won't be installed either.
View gist:1db9c8fe9cfc36623921b611549d5096
// delete all the local branches except master branch
git branch | grep -v "master" | xargs git branch -D
View gist:b03315130351053c99c8492109d29e4f
git fetch origin
git checkout feature/example-branch
git reset --hard origin/feature/example-branch
git fetch origin
git checkout master
git reset --hard origin/master
View navbar.js
import './navbar.scss'
import React from 'react'
const Navbar = () => (
/* Navigation bar stuff goes here */
export default Navbar
jamigibbs / webpack.config.js
Created Nov 4, 2018
Webpack config example with sass
View webpack.config.js
const isDev = process.env.NODE_ENV === 'development'
module.exports = {
mode: isDev ? 'development' : 'production',
entry: [
'@babel/polyfill', // enables async-await
output: {
path: __dirname,
View prod_test.js
{{checkType (prod)}}
Handlebars.registerHelper('checkType', (val) => {
console.log(val, '-->', typeof val)
// false --> boolean
// true --> boolean
View hbs-helpers02.js
Handlebars.registerHelper('outer-helper', (result, greeting) => {
return `${result} ${greeting}`
Handlebars.registerHelper('inner-helper', (name) => {
return `Hello, ${name}.`
View subexp01.hbs
{{outer-helper (inner-helper 'Jami') 'How are you?'}}
You can’t perform that action at this time.