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 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 = () => (
<div>
/* Navigation bar stuff goes here */
</div>
)
export default Navbar
@jamigibbs
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
'./client/index.js'
],
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?'}}
View example2.hbs
<div class="some-content">
{{#if (prod)}}
<p>Seen only in production</p>
{{/if}}
<p>This is some example text</p>
</div>
View example.hbs
<div class="some-content">
{{#if prod}}
<p>Seen only in production</p>
{{/if}}
<p>This is some example text</p>
</div>
You can’t perform that action at this time.