Skip to content

Instantly share code, notes, and snippets.

View eduwass's full-sized avatar
:octocat:
working remotely

Edu Wass eduwass

:octocat:
working remotely
View GitHub Profile
@eduwass
eduwass / docker-compose.yml
Last active May 18, 2025 16:14
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 / 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 / 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 / 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 / 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 / _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 / 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 / 0. Custom Date Formats in Rails.md
Last active February 12, 2025 06:25
Custom Date Formats in Rails

Custom Date Formats in Rails

Quick guide on printing pretty dates in Rails

@eduwass
eduwass / gulpfile.js
Created November 23, 2015 10:04
Gulp task to SSH into production server and retrieve mysqldump
////////////////////////////////////////////////////////////////////
// Run: 'gulp download-db' to get latest SQL dump from production //
// File will be put under the 'dumps' folder //
////////////////////////////////////////////////////////////////////
// Load stuff
'use strict'
var gulp = require('gulp')
var GulpSSH = require('gulp-ssh')
var fs = require('fs');
@eduwass
eduwass / setup.sh
Last active January 3, 2020 18:27
Flynn Install : Single node ( for Ubuntu 14.04 x64 @ DigitalOcean droplet )
#!/bin/bash
# This script will automatically set up a single node Flynn Cluster on your linux box
# Fresh Flynn install with domain provided by the xip.io service
# Tested with Base Image: Ubuntu 14.04 x64 @ DigitalOcean droplet
# @date 16 Nov 2015
# @author Edu Wass (eduwass at gmail com)
echo '---- START SETUP ----'