Skip to content

Instantly share code, notes, and snippets.

View reatlat's full-sized avatar
🍋
Life gave me lemons, I forked.

Alex Zappa reatlat

🍋
Life gave me lemons, I forked.
View GitHub Profile
@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 / theme-options.php
Created April 23, 2018 13:04 — forked from mfields/theme-options.php
Sample theme options page for WordPress Themes.
<?php
/**
* _s Theme Options
*
* @package _s
* @since _s 1.0
*/
/**
* Register the form setting for our _s_options array.
@reatlat
reatlat / install-yaourt.sh
Created June 2, 2018 20:20 — forked from blakek/install-yaourt.sh
An easy yaourt install script for Arch Linux (and variants). Made so I can set up Arch either offline or online without having to remember what I need.
#!/bin/bash -e
make_a_pkg() {
printf '** Making package "%s"...\n' "$1"
tar zxf "$1.tar.gz"
cd "$1"
makepkg -si
cd ..
}
@reatlat
reatlat / docker-compose-daemon.sh
Created June 2, 2018 20:35 — forked from domachine/docker-compose-daemon.sh
run docker-compose in daemon mode and attach to web container
docker-compose up -d
docker attach myapp_web_1