- Bash/zsh completion
- use Tab to populate command line, narrows down options as you go, fills in container names, ID's, images, volumes. Huge time saver.
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
/** | |
* Add the following to a theme's functions.php file. | |
*/ | |
function example_enqueue_block_variations() { | |
wp_enqueue_script( | |
'frost-enqueue-block-variations', | |
get_template_directory_uri() . '/assets/js/variations.js', | |
array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ) | |
); |
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 | |
/** | |
* Get array of post ID's with specific meta key and value | |
* | |
* @param string $meta_key - The meta key you are checking for | |
* @param string $meta_value - The meta value for the meta key you're checking for | |
* @param string $post_type - The post type to use with get_posts() - default: post | |
* | |
* @return array | |
*/ |
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 App\Nova\Filters; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Carbon; | |
use Illuminate\Container\Container; | |
use Laravel\Nova\Filters\DateFilter as NovaDateFilter; | |
class DateFilter extends NovaDateFilter |
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
<h1>Infinite Scroll - Masonry image grid</h1> | |
<div class="grid are-images-unloaded"> | |
<div class="grid__col-sizer"></div> | |
<div class="grid__gutter-sizer"></div> | |
<div class="grid__item grid__item--height2"></div> | |
<div class="grid__item grid__item--width2"> | |
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/82/orange-tree.jpg" alt="orange tree" /> | |
</div> | |
<div class="grid__item grid__item--height3"></div> |
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 App\Traits; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Database\Eloquent\ModelNotFoundException; | |
use Ramsey\Uuid\Uuid; | |
trait Uuids { |
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
<script> | |
import UseModal from './shared/modal/UseModalMixin.js'; | |
export default { | |
mixins: [UseModal], | |
}; | |
</script> | |
<template> | |
<modal size="md" v-ref:modal> |
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
# NOT FOR SHELL SCRIPT, but rather just for quick copy paste | |
# this is a copy-paste version with defaults of the full shell script docker-xenial.sh which is below this one in gist. | |
apt-get -y install apt-transport-https ca-certificates curl && \ | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \ | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" && \ | |
service lxcfs stop && apt-get remove -y -q lxc-common lxcfs lxd lxd-client && \ | |
apt-get update -q && \ | |
apt-get install -y -q docker-ce && \ | |
printf '{ "userns-remap" : "default" , "storage-driver" : "overlay2" }' > /etc/docker/daemon.json && \ |
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
<template> | |
<ul class="pagination"> | |
<li v-show="current_page != 1"> | |
<a href="javascript:;" | |
aria-label="Previous" | |
v-on:click="previousPage()"> | |
<span aria-hidden="true">«</span> | |
</a> | |
</li> | |
<li v-for="page in total_pages" |
This is a ServiceWorker template to turn small github pages into offline ready app.
Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html
file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js
files). I wanted to cache these files so that I can access my tools offline as well.
Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS
of your repository.
NewerOlder