3 hidden CSS tips
1. Use empty-cells to style table empty cells:
Surprisingly the browser support is quite good and extends back to IE8. Convenient to give less visual predominance to empty cells.
table {
empty-cells: hide;
}| <?php | |
| namespace App\Http\Livewire; | |
| use Livewire\Component; | |
| use App\Http\Livewire\Concerns\FormRequest; | |
| class ExampleUsage extends Component | |
| { | |
| use FormRequest; |
| <?php | |
| /** | |
| * Adds a detailed UI to WP's thumbnail HTML markup used in the Feature Image metabox. | |
| * | |
| * Adds a description of featured images, a listing of the formats used by GV and | |
| * previews of how the images will appear in features slider and thumbnails. | |
| * | |
| * Note that $thumbnail_id is only saved when the post is saved. Immediately after the featured image is changed | |
| * this value is updated, but not the postmeta field in the database (nor OUR fields which are tied to it) | |
| * SO: |
| The regex patterns in this gist are intended only to match web URLs -- http, | |
| https, and naked domains like "example.com". For a pattern that attempts to | |
| match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
| License: https://opensource.org/license/bsd-3-clause | |
| # Single-line version: | |
| (?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps |
| <?php | |
| /* | |
| * Dynamically Generated Checkboxes in a WordPress Settings Page | |
| * | |
| * This file is fully functional and ready to be used in a plugin or theme to generate this Settings Page | |
| * | |
| */ | |
| Class Pizza_Shop { |
| <?php | |
| /** | |
| * [list_searcheable_acf list all the custom fields we want to include in our search query] | |
| * @return [array] [list of custom fields] | |
| */ | |
| function list_searcheable_acf(){ | |
| $list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
| return $list_searcheable_acf; | |
| } |
| /* Row and Column defaults */ | |
| .row { margin-left: auto; margin-right: auto; margin-top: 0; margin-bottom: 0; max-width: 62.5em; width: 100%; } | |
| .row .row.collapse { margin-left: 0; margin-right: 0; max-width: none; width: auto; } | |
| .row .row { margin-left: -0.9375em; margin-right: -0.9375em; max-width: none; width: auto; } | |
| .row.collapse .column, .row.collapse .columns { padding-left: 0; padding-right: 0; float: left; } | |
| .column, .columns { padding-left: 0.9375em; padding-right: 0.9375em; width: 100%; float: left; position: relative; } | |
| /* Up to 640px */ | |
| @media only screen { | |
| .small-1 { width: 8.33333% } |
| /* The Grid ---------------------- */ | |
| .lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; } | |
| .lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
| .lt-ie9 .row.large-collapse .column, | |
| .lt-ie9 .row.large-collapse .columns { padding: 0; } | |
| .lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
| .lt-ie9 .row .row.large-collapse { margin: 0; } | |
| .lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; } | |
| .lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; } |
| if (window.navigator.geolocation) { | |
| var accuracyThreshold = 100, | |
| timeout = 10 * 1000, | |
| watchID = navigator.geolocation.watchPosition(function(position) { | |
| $('#latitude').val(position.coords.latitude); // set your latitude value here | |
| $('#longitude').val(position.coords.longitude); // set your longitude value here | |
| // if the returned distance accuracy is less than your pre-defined accuracy threshold, | |
| // then clear the timeout below and also clear the watchPosition to prevent it from running continuously |