Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.
$ npm install mongoose --save
const mongoose = require('mongoose');
/* require */ | |
var gulp = require('gulp'), | |
browserSync = require('browser-sync'), | |
reload = browserSync.reload, | |
sass = require('gulp-ruby-sass'), | |
plumber = require('gulp-plumber'), | |
rename = require('gulp-rename'), | |
uglify = require('gulp-uglify'), | |
minifyCss = require('gulp-minify-css'), | |
imagemin = require('gulp-imagemin'), |
document.getElementsByTagName('button')[0].onclick = function () { | |
scrollTo(document.body, 0, 1250); | |
} | |
function scrollTo(element, to, duration) { | |
var start = element.scrollTop, | |
change = to - start, | |
currentTime = 0, | |
increment = 20; | |
<?php | |
class ContactFormProcessing | |
{ | |
protected $action = 'contact_form'; | |
public function ajaxInit() | |
{ | |
add_action("wp_ajax_{$this->action}", [$this, 'process']); | |
add_action("wp_ajax_nopriv_{$this->action}", [$this, 'process']); | |
} | |
/** |
let pageNumber = 2; | |
const MAX_PAGES_TO_GO_THROUGH = 10; | |
function scrollToBottom() { | |
window.scrollTo(0,document.body.scrollHeight); | |
} | |
function goToNextPage() { | |
document.querySelector('[aria-label="Page '+ pageNumber +'"]').click(); | |
setTimeout(() => { |
# ---------------------------------------------------------------------- | |
# Rewrites / permalinks | |
# ---------------------------------------------------------------------- | |
# ---------------------- | |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /blog/ | |
RewriteRule ^index\.php$ - [L] |
# Installation --- | |
# 1. In Bitbucket, add $FTP_USERNAME $FTP_PASSWORD and $FTP_HOST as environment variables. | |
# 2. Commit this file to your repo | |
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will | |
# push everything and initial GitFTP) | |
# | |
# Usage --- | |
# - On each commit to master branch, it'll push all files to the $FTP_HOST | |
# - You also have the option to 'init' (from Bitbucket Cloud) - pushes everything and initialises | |
# - Finally you can also 'deploy-all' (from Bitbucket Cloud) - if multiple deploys fail, you |
<!doctype html> | |
<html> | |
<head> | |
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?sensor=false"></script> | |
<meta charset="UTF-8"> | |
<title>Example Google Map</title> | |
</head> | |
<body> | |
<div id="map-canvas" style="height:400px; width:600px;"></div> | |
<script> |
// background: linear-gradient( | |
// hsl(359, 100%, 100%) 0%, | |
// hsla(359, 100%, 100%, 0.738) 19%, | |
// hsla(359, 100%, 100%, 0.541) 34%, | |
// hsla(359, 100%, 100%, 0.382) 47%, | |
// hsla(359, 100%, 100%, 0.278) 56.5%, | |
// hsla(359, 100%, 100%, 0.194) 65%, | |
// hsla(359, 100%, 100%, 0.126) 73%, | |
// hsla(359, 100%, 100%, 0.075) 80.2%, | |
// hsla(359, 100%, 100%, 0.042) 86.1%, |
const _headerFN = () => { | |
const $header = document.querySelector('.header'); | |
const scrollTop = window.scrollY, | |
offsetTop = 60; | |
if (scrollTop >= offsetTop && window.innerWidth > 767) { | |
$header.classList.add('jsOnScroll'); | |
document.body.classList.add('jsOnScroll-header'); | |
} else { |