This Gist acompanies my post: WP-CLI: Remote WP Management
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
| { | |
| "name": "tsquickstart", | |
| "version": "1.0.0", | |
| "description": "Boilerplate for quick one-off TypeScript projects. Just run `npm start`", | |
| "scripts": { | |
| "init": "test -f tsconfig.json || (tsc --init -t ESNext -m ESNext && npm install)", | |
| "start": "npm run init && concurrently \"npm run watch\" \"npm run serve\"", | |
| "serve": "http-server", | |
| "watch": "tsc -p . --watch", | |
| "build": "tsc -p ." |
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
| #!/bin/env bash | |
| echo "\n\n Checking if package.json exists" | |
| if [ -f package.json ] | |
| then | |
| echo "\n\n package.json exists." | |
| else | |
| echo "\n\n package.json doesn't exists... creating" | |
| npm init --yes | |
| fi |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <title>Test</title> | |
| <style> | |
| .slogan span:nth-child(odd) { | |
| color: red; | |
| } | |
| </style> | |
| </head> |
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
| \documentclass[12pt, letterpaper, titlepage]{article} | |
| % font size could be 10pt (default), 11pt or 12 pt | |
| % paper size could be letterpaper (default), legalpaper, executivepaper, | |
| % a4paper, a5paper or b5paper | |
| % side could be oneside (default) or twoside | |
| % columns could be onecolumn (default) or twocolumn | |
| % graphics could be final (default) or draft | |
| % | |
| % titlepage could be notitlepage (default) or titlepage which | |
| % makes an extra page for title |
This gist contains the source code in my video series about Realtime Database triggers. You can watch the three parts here:
index.ts contains the Cloud Functions code, and dialog.ts contains the script to run
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
| class LazyVideoLoader { | |
| constructor() { | |
| this.videos = [].slice.call(document.querySelectorAll('.hero__bgvideo')); | |
| // Abort when: | |
| // - The browser does not support Promises. | |
| // - There no videos. | |
| // - If the user prefers reduced motion. | |
| // - Device is mobile. | |
| if ( |
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
| /* Monospaced font for code samples */ | |
| @font-face { | |
| font-family: "notomono_regular"; | |
| src: url("../fonts/notomono-regular.eot"); | |
| src: url("../fonts/notomono-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/notomono-regular.woff2") format("woff2"), url("../fonts/notomono-regular.woff") format("woff"), url("../fonts/notomono-regular.ttf") format("truetype"), url("../fonts/notomono-regular.svg#notomono_regular") format("svg"); | |
| font-weight: normal; | |
| font-style: normal; | |
| } | |
| /* Regular font */ | |
| @font-face { |
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
| /* Monospaced font for code samples */ | |
| @font-face { | |
| font-family: "notomono_regular"; | |
| src: url("../fonts/notomono-regular.eot"); | |
| src: url("../fonts/notomono-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/notomono-regular.woff2") format("woff2"), url("../fonts/notomono-regular.woff") format("woff"), url("../fonts/notomono-regular.ttf") format("truetype"), url("../fonts/notomono-regular.svg#notomono_regular") format("svg"); | |
| font-weight: normal; | |
| font-style: normal; | |
| } | |
| /* Regular font */ | |
| @font-face { |
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
| <filter id="displacement" filterUnits="objectBoundingBox"> | |
| <feTurbulence type="turbulence" baseFrequency="0.01" numOctaves="2" result="turb"/> | |
| <feColorMatrix in="turb" result="huedturb" type="hueRotate" values="90"> | |
| <animate attributeType="XML" attributeName="values" values="0;180;360" dur="6s" repeatCount="indefinite"/> | |
| </feColorMatrix> | |
| <feDisplacementMap in="SourceGraphic" in2="huedturb" scale="20" result="displace" xChannelSelector="B"/> | |
| <feOffset dx="-5" dy="-5" in="displace" result="unoffsetdisplace"/> | |
| </filter> |