Skip to content

Instantly share code, notes, and snippets.

View eduwass's full-sized avatar
❄️
working remotely

Edu Wass eduwass

❄️
working remotely
View GitHub Profile
@eduwass
eduwass / functions.php
Created May 3, 2016 19:18
Hide WooCommerce subscriptions text (in product and cart pages) from products with a set Price but no Subscription Fee
// Define which products we should hide the subscription text for
function should_hide_subscription_text($product){
$is_subscription = (get_class($product) == 'WC_Product_Variable_Subscription');
$has_price = (intval($product->subscription_price)>0);
$has_fee = (intval($product->subscription_sign_up_fee)>0);
if($is_subscription && $has_price && !$has_fee){
return true;
} else {
return false;
}
@eduwass
eduwass / _grid.scss
Created June 22, 2016 13:47
Skeleton Custom Grid (SASS)
/*
* Skeleton V2.0.4 (Customised Grid Only)
* Sass Version by Seth Coelen https://github.com/whatsnewsaes
*
* Customised by Edu Wass
* Includes:
* - breakpoint variables
* - offset classes
* - push/pull classes
* - visibilty classes
@eduwass
eduwass / commands.md
Last active December 21, 2016 13:50
Docker cheatsheet

Stop / remove all Docker containers

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

Remove dangling Docker images

docker rmi $(docker images -q -f dangling=true)
@eduwass
eduwass / functions.php
Created January 17, 2017 17:18
WooCommerce Product Bundles - Check if cart contains a Product Bundle Container
<?php
/**
* Checks if the cart contains a product bundle
* @return [bool]
*/
function cart_contains_product_bundle(){
global $woocommerce;
$contains_product_bundle = false;
if ( sizeof( WC()->cart->get_cart() ) > 0 ) {
// if cart has items
@eduwass
eduwass / functions.php
Last active January 11, 2018 03:14
Lower password strength requirements in WooCommerce
<?php
// Allow Weaker passwords
add_filter( 'woocommerce_min_password_strength', 'uh_oh_weakpasswords' );
function uh_oh_weakpasswords() {
return 1;
}
@eduwass
eduwass / README.md
Last active March 3, 2017 10:51
Laravel Development Cheatsheet

Intro

Date: 2 Feb 2017

Laravel version: 5.1.0

Guide assumes that you have installed Homestead following official guide, and have the homesteadcommand alias:

@eduwass
eduwass / docker-compose.yml
Last active December 31, 2023 00:31
Mailhog + WordPress in docker-compose.yml
version: '3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
@eduwass
eduwass / fitmetrixapi.php
Last active September 14, 2018 18:06
Fitmetrix quick'n'dirty API Wrapper
<?php
class FitmetrixAPI{
private $base_url;
private $encoded_auth;
private $facility_location_id;
public function __construct($token, $token_key, $facility_location_id){
$this->base_url = 'https://api.fitmetrix.io/api/';
@eduwass
eduwass / iStat Menus Settings.ismp
Created December 13, 2018 15:58
iStat menus settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>build</key>
<real>1087</real>
<key>license</key>
<dict>
<key>email</key>
<string>eduwass@gmail.com</string>
@eduwass
eduwass / script.js
Created February 28, 2019 19:01 — forked from marcosnakamine/script.js
jQuery - WP Smush auto click
setInterval(function(){
botao = jQuery('#smush-box-meta-boxes-bulk > div.sui-box-body > div.wp-smush-bulk-wrapper > button');
if( botao.attr('disabled') != 'disabled' ) {
botao.trigger('click');
}
}, 1000);