Skip to content

Instantly share code, notes, and snippets.

Handlebars is a semantic web template system, started by Yehuda Katz in 2010.
Handlebars.js is a superset of Mustache, and can render Mustache templates in addition to Handlebars templates.
More: http://handlebarsjs.com/
1. Expressions.
1.1 Basic usage.
@oilsinwater
oilsinwater / gulpfile.js
Created September 9, 2018 05:11
gulp file
/**
* Gulp config
*/
// Load plugins
let gulp = require('gulp');
let gulpLoadPlugins = require('gulp-load-plugins');
let del = require('del');
let browserSync = require('browser-sync').create();
let browserify = require('browserify');
const staticCache = 'static-restaurant-1';
//open cache and add specified files to it
const requiredFiles = [
'/sw.js',
'/index.html',
'/restaurant.html',
'/js/dbhelper.js',
'/js/main.js',
@oilsinwater
oilsinwater / settings.json
Last active August 5, 2018 01:01
VS Code settings
{
"cSpell.language": "en",
"cSpell.userWords": [
"Drummond",
"Philliph",
"celsius",
"kelvin",
"newton",
"require"
],
@oilsinwater
oilsinwater / config
Created August 2, 2018 01:46
~/.ssh/config
# ssh(1) obtains configuration data from the following sources in the following order:
#
# 1. command-line options
# 2. user's configuration file (~/.ssh/config)
# 3. system-wide configuration file (/etc/ssh/ssh_config)
#
# For each parameter, the first obtained value will be used. The configuration files contain sections separated
# by “Host” specifications, and that section is only applied for hosts that match one of the patterns given in the
# specification. The matched host name is the one given on the command line.
#
@oilsinwater
oilsinwater / cryptoZombies.md
Last active January 25, 2024 16:46
CryptoZombies Notes

CryptoZombies.io Notes

Contracts

Solidty's code is encapsulated in contracts. A contract is the fundamental building block of Ethereum applications -- i.e. all variables and functions belong to a contract, and are the starting point of your project. Below is an example of an empty contract called HelloWorld.

@oilsinwater
oilsinwater / hamburger.js
Created May 24, 2018 23:56
Off-Canvas Hamburger menu
// Here's the JavaScript used to toggle the open class:
menu.addEventListener('click', function(e) {
drawer.classList.toggle('open');
e.stopPropagation();
});
// Here's the relevant CSS for transitioning the hamburger menu:
nav {
@oilsinwater
oilsinwater / regExNotes.md
Last active June 1, 2022 02:05
RegEx notes

RegEx Notes

Regular Expression Basics

expression description
. Any character except newline
a The character a
ab The string ab
@oilsinwater
oilsinwater / serviceWorkerCaching.md
Created February 19, 2018 23:40
Caching files Service Workers

[TOC]

Caching files Service Workers

@(js study notes)[js|dev|web]

##What is Cache API?

While this API was intended for service workers, it is actually exposed on the window so it can be accessed from anywhere in your script. The entry point is caches.

  • ** Used to store assets that have a URL
@oilsinwater
oilsinwater / serviceWorkerLiveData.md
Last active February 13, 2018 11:42
Working with Live Data in the Service Worker

[TOC]

Working with Live Data in the Service Worker

What's the best place to store data?

Imagining the example of an typical e-commerce site with multiple kinds of data, there are images and numeric data, as well as HTML and CSS resources, and probably JavaScript as well. The question here is, which data should go where?