- http://stackoverflow.com/questions/804115 (
rebase
vsmerge
). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebase
vsmerge
) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
reset
vscheckout
vsrevert
) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse
) - http://stackoverflow.com/questions/292357 (
pull
vsfetch
) - http://stackoverflow.com/questions/39651 (
stash
vsbranch
) - http://stackoverflow.com/questions/8358035 (
reset
vscheckout
vsrevert
)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
// Load plugins | |
const autoprefixer = require("autoprefixer"); | |
const browsersync = require("browser-sync").create(); | |
const cp = require("child_process"); | |
const cssnano = require("cssnano"); | |
const del = require("del"); | |
const eslint = require("gulp-eslint"); | |
const gulp = require("gulp"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
def fish_to_zsh(cmd): | |
return (cmd.replace('; and ', '&&') | |
.replace('; or ', '||')) | |
with open(os.path.expanduser('~/.zsh_history.test'), 'a') as o: | |
with open(os.path.expanduser('~/.local/share/fish/fish_history')) as f: | |
for line in f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = async (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
Workbox runtime caching recipes
Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:
importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();
// Placeholder array populated automatically by workboxBuild.injectManifest()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.window-title, div.panel-header div.title, a.editor-status-mode, | |
div.results-group, span.quick-open-entry-description>span.monaco-highlighted-label:first-child, | |
.input, div.column.when span, | |
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json .mtk12, | |
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json .mtk9, | |
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json .mtk4, | |
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json .mtk3.mtki.detected-link, | |
.Equinusocio-vsc-material-theme-themes-Material-Theme-Palenight-json span.mtk11.mtki, | |
.Tyriar-theme-sapphire-theme-bright-json .mtk6, | |
.zhuangtongfa-Material-theme-themes-OneDark-Pro-json .mtk6, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Your\Custom\Namespace; | |
/** | |
* Send a custom admin email when a new customer creates a new account. | |
* @param integer $user_id The ID of the user whose data should be retrieved. | |
* @return [type] [description] | |
*/ | |
function customer_registration_email_alert( $user_id ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Change size for Yoast SEO OpenGraph image for all content | |
* Credit: Yoast Development team | |
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1 | |
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail' | |
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/ | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fractal = require('@frctl/fractal').create() | |
require('./setup')(fractal) | |
const server = require('./server')(fractal, { | |
port: 4000, | |
sync: true, | |
watch: true, | |
syncOptions: { | |
files: [ | |
'files-i-want-to-watch-also.css', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// auth-guard.ts | |
import { Injectable } from '@angular/core'; | |
import { | |
CanActivate, | |
Router, | |
ActivatedRouteSnapshot, | |
RouterStateSnapshot | |
} from '@angular/router'; | |
import { AuthService } from './services/auth/auth.service'; |