-
Make a droplet using LAMP Instance
-
Add a new user (i.e. deployer)
adduser deployer -
Add the new user to sudo group
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
| var striptags = require('striptags') | |
| function smartExcerpt (string) { | |
| var re = /(^.*?[a-zA-Z0-9\)\”\"]{2,}[.!?])[\s\”\"]+\W*[A-Z]/ | |
| var matches = striptags(string).match(re) | |
| return matches && matches[1] ? matches[1] : string | |
| } |
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 | |
| function getElementByClassname ($html, $classname) { | |
| $dom = new DOMDocument(); | |
| $dom->loadHTML($html); | |
| $xpath = new DOMXpath($dom); | |
| $nodes = $xpath->query('//div[@class="' . $classname . '"]'); | |
| $tmp_dom = new DOMDocument(); |
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 { useState } from "react"; | |
| import Image from "next/image"; | |
| export default function FadeInImage({ ...props }) { | |
| const [isLoaded, setIsLoaded] = useState(false); | |
| const { className, src, alt, priority, layout, objectFit, width, height } = | |
| props; | |
| function onLoadingComplete() { | |
| setIsLoaded(true); |
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 | |
| /** | |
| * Built-in PHP server router: | |
| * | |
| * - If file exists, serve file | |
| * - Access php files without .php extension | |
| * - Unknown routes throw 404 | |
| * - Optionally fallback to index.php | |
| * |
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 querystate from 'querystate' | |
| import nanobus from 'nanobus' | |
| const state = querystate() | |
| const bus = nanobus() | |
| // emit state on history change | |
| ;(function(history){ | |
| var pushState = history.pushState | |
| var popState = history.popState |
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 { define } from 'wicked-elements' | |
| import onIntersect from '../lib/on-intersect.js' | |
| define('[data-component~="ultralazy"]', { | |
| init () { | |
| this.state = {} | |
| this.onEnter = this.onEnter.bind(this) | |
| this.onLoad = this.onLoad.bind(this) | |
| }, | |
| connected () { |
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 { define } from 'wicked-elements' | |
| define('[data-component~="overscroll-none"]', { | |
| init () { | |
| }, | |
| connected () { | |
| if (!CSS.supports('overscroll-behavior', 'none')) { | |
| this.wheelingTimeout = false | |
| this.lock = this.lock.bind(this) |
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 $ = (selector, parent = document) => parent.querySelector(selector) | |
| const $$ = (selector, parent = document) => [...parent.querySelectorAll(selector)] | |
| const createNode = html => { | |
| return new DOMParser().parseFromString(html, 'text/html').body.firstChild | |
| } |
Use the "Custom Content" section in a debut theme to add a code block with the contents of shopify-redirect.js. This will allow you to create a user-editable redirect. The code is wrapped in an iFrame check so the redirect is not triggered while in the editor. Editors can toggle the redirect on/off by showing/hiding that section.
NewerOlder