-
When writing a string of multiple utility classes, always do so in an order with meaning. The "Concentric CSS" approach works well with utility classes (i.e,. 1. positioning/visibility 2. box model 3. borders 4. backgrounds 5. typography 6. other visual adjustments). Once you establish a familiar pattern of ordering, parsing through long strings of utility classes will become much, much faster so a little more effort up front goes a long way!
-
Always use fewer utility classes when possible. For example, use
mx-2instead ofml-2 mr-2and don't be afraid to use the simplerp-4 lg:pt-8instead of the longer, more complicatedpt-4 lg:pt-8 pr-4 pb-4 pl-4. -
Prefix all utility classes that will only apply at a certain breakpoint with that breakpoint's prefix. For example, use
block lg:flex lg:flex-col lg:justify-centerinstead ofblock lg:flex flex-col justify-centerto make it very clear that the flexbox utilities are only applicable at the
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 pathlib | |
| import sqlite3 | |
| target_path = "" | |
| movie_list = [] | |
| tv_list = [] | |
| collection_list = [] | |
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
| curl https://046a1a87-api.agilitycms.cloud/fetch/en-us/sitemap/flat/website | |
| --header "APIKey: defaultlive.2b7f3a91559d794bedb688358be5e13af2b1e3ae8cd39e8ed2433bbef5d8d6ac" | |
| { | |
| "/home": { | |
| "title": "Home", | |
| "name": "home", | |
| "pageID": 2, | |
| "menuText": "New Home Text", | |
| "visible": { | |
| "menu": false, |
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
| // This utility is to keep track of a list of keys (entity IDs no doubt) in last access | |
| // order. The oldest entities can be popped off the list, and new entities can be added. | |
| // The premise is a bidirectional linked list along with an ID hash to an point in the | |
| // linked list. The reason behind the complexity is performance. | |
| export default () => { | |
| let first = null; | |
| let last = null; | |
| const hash = {}; | |
| let size = 0; |
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/bash | |
| # requires gcloud command line tools; go to https://cloud.google.com/sdk/docs/quickstarts to get them | |
| # max 100 service accounts per project | |
| # run gcloud init --console-only first and select a project | |
| # | |
| # Want to use these for rclone? Service Account Loadbalancing is implemented in this build: | |
| # https://git.fionera.de/fionera/rclone/releases | |
| KEYS_DIR=~/keys | |
| for name in service{1..100}; do | |
| echo $name |
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
| #!/usr/bin/env bash | |
| # Backup a Plex database. | |
| # Author Scott Smereka | |
| # Ubuntu | |
| # Version 1.0 | |
| # Modified by Shaun Harrison | |
| # Ubuntu | |
| # Version 1.1 |
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 _ = require('lodash'); | |
| module.exports = ({e, addUtilities, config}) => { | |
| const gradients = config('gradients', []) | |
| const variants = config('modules.gradients') | |
| const gradientUtilities = _.map(gradients, (colors, name) => { | |
| if (!_.isArray(colors)) { | |
| colors = ['transparent', colors]; | |
| } |
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
| [Unit] | |
| Description=rclone - rsync for cloud storage | |
| Documentation=https://rclone.org/docs/ | |
| After=network-online.target | |
| Before=caddy.service | |
| Wants=network-online.target systemd-networkd-wait-online.service | |
| Requires=caddy.service | |
| [Service] | |
| Restart=on-abnormal |
Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin-panel SPA, nuxt.js renderer and JSON API.
This manual is relevant for VPS such as DigitalOcean.com or Vultr.com. It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger than a landing page.
UPD: This manual now compatible with nuxt@2.3. For older versions deployment, see revision history.
Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:
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 | |
| /** | |
| * Enqueue block styles on frontend and in editor | |
| * | |
| */ | |
| function mytheme_block_styles() { | |
| wp_enqueue_style( 'mytheme-blocks', get_stylesheet_directory_uri() . '/css/blocks.css' ); |