Skip to content

Instantly share code, notes, and snippets.

View reatlat's full-sized avatar
🖖
Live long and prosper!

Alex Zappa reatlat

🖖
Live long and prosper!
View GitHub Profile
@reatlat
reatlat / examples.md
Created June 12, 2017 19:24 — forked from ErisDS/examples.md
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

@reatlat
reatlat / facebook
Created June 30, 2017 06:59 — forked from hotmeteor/facebook
Social media meta tag templates
<!-- Social: Facebook / Open Graph -->
<meta property="fb:admins" content="503386332">
<meta property="fb:app_id" content="1389892087910588">
<meta property="og:url" content="http://scotch.io/bar-talk/bootstrap-3-tips-and-tricks-you-might-not-know">
<meta property="og:type" content="article">
<meta property="og:title" content="Bootstrap 3 Tips and Tricks You Might Not Know">
<meta property="og:image" content="/wp-content/uploads/2014/05/bs31.jpg"/>
<meta property="og:description" content="Bootstrap 3 has a ton of features and helpers to speed up front-end development. Sometimes you need something and you end up writing your own custom CSS and JavaScript without even realizing that Bootstrap could have done it for you....">
<meta property="og:site_name" content="Scotch">
<meta property="article:author" content="https://www.facebook.com/NCerminara">
@reatlat
reatlat / 1-remove-woocommerce-tabs.php
Created July 20, 2017 09:35 — forked from kittenlane/1-remove-woocommerce-tabs.php
Remove tabs but keep product description in WooCommerce
//* http://gasolicious.com/remove-tabs-keep-product-description-woocommerce/
// Location: add to functions.php
// Output: removes woocommerce tabs
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
DELIMITER $$
DROP FUNCTION IF EXISTS `database`.`HTML_UnEncode`$$
CREATE DEFINER=`root`@`127.0.0.1` FUNCTION `HTML_UnEncode`(x VARCHAR(255)) RETURNS varchar(255) CHARSET latin1
BEGIN
DECLARE TextString VARCHAR(255) ;
SET TextString = x ;
#quotation mark
@reatlat
reatlat / remove-theme-mods-keep-menus
Created October 29, 2017 22:25 — forked from wpexplorer/remove-theme-mods-keep-menus
Remove all WordPress theme_mods but keep menu locations
// Get menu locations and save to array
$locations = get_theme_mod( 'nav_menu_locations' );
$save_menus = array();
foreach( $locations as $key => $val ) {
$save_menus[$key] = $val;
}
// Remove all mods
remove_theme_mods();
// Re-add the menus
set_theme_mod( 'nav_menu_locations', array_map( 'absint', $save_menus ) );
@reatlat
reatlat / remove-docker-containers.md
Created November 26, 2017 22:55 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images
@reatlat
reatlat / gist:d7d0b8b9754c0b74669b2c058771530d
Created December 8, 2017 02:21 — forked from fabiofl/gist:5873100
Clear Mac OS X's icon cache.
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \;
@reatlat
reatlat / html-languages.txt
Created December 18, 2017 11:21 — forked from JamieMason/html-languages.txt
HTML lang attribute / ISO language code reference / Culture names
CULTURE SPEC.CULTURE ENGLISH NAME
--------------------------------------------------------------
Invariant Language (Invariant Country)
af af-ZA Afrikaans
af-ZA af-ZA Afrikaans (South Africa)
ar ar-SA Arabic
ar-AE ar-AE Arabic (U.A.E.)
ar-BH ar-BH Arabic (Bahrain)
ar-DZ ar-DZ Arabic (Algeria)
ar-EG ar-EG Arabic (Egypt)
@reatlat
reatlat / style.css
Created January 22, 2018 21:39
DIVI: Changing the Breakpoint of the Mobile Menu
/* Setting the breakpoint of the mobile menu */
@media only screen and ( max-width: 981px ) {
#top-menu-nav, #top-menu {display: none;}
#et_top_search {display: none;}
#et_mobile_nav_menu {display: block;}
}
@reatlat
reatlat / automatic-copyright-year.php
Created April 4, 2018 19:41
Automatic copyright year