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 / 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);
@eduwass
eduwass / 0. Custom Date Formats in Rails.md
Last active June 7, 2021 22:32
Custom Date Formats in Rails

Custom Date Formats in Rails

Quick guide on printing pretty dates in Rails

@eduwass
eduwass / search.php
Created February 12, 2021 13:09
Xero for WooCommerce Available Filters
<?php
54 results - 15 files
web/app/plugins/woocommerce-xero/includes/class-wc-xr-address.php:
20 public function get_type() {
21: return apply_filters( 'woocommerce_xero_address_type', $this->type, $this );
22 }
34 public function get_line_1() {
{"0":{"title":"Vimeo Upload","description":"","labelPlacement":"top_label","descriptionPlacement":"below","button":{"type":"text","text":"Submit","imageUrl":""},"fields":[{"type":"dgv_vimeo_upload","id":2,"label":"Video","adminLabel":"","isRequired":false,"size":"medium","errorMessage":"","visibility":"visible","inputs":null,"allowedExtensions":"mp4,mov,wmv,avi,flv","formId":1,"description":"","allowsPrepopulate":false,"inputMask":false,"inputMaskValue":"","inputMaskIsCustom":false,"maxLength":"","inputType":"","labelPlacement":"","descriptionPlacement":"","subLabelPlacement":"","placeholder":"","cssClass":"","inputName":"","noDuplicates":false,"defaultValue":"","choices":"","conditionalLogic":"","maxFileSize":"","maxFiles":"","multipleFiles":false,"productField":"","calculationFormula":"","calculationRounding":"","enableCalculation":"","disableQuantity":false,"displayAllCategories":false,"useRichTextEditor":false,"fields":"","displayOnly":""},{"type":"text","id":3,"label":"Course ID","adminLabel":"","isRequi
@eduwass
eduwass / index.html
Created July 28, 2020 15:17
Bootstrap 4 HTML Test Code
<html>
<!-- Navbar
================================================== -->
<div class="bs-docs-section clearfix">
<div class="row">
<div class="col-lg-12">
<div class="page-header">
<h1 id="navbars">Navbars</h1>
</div>
@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 ----'
@eduwass
eduwass / Default (OSX).sublime-keymap
Created October 8, 2019 15:22
Sublime Text Automatic Brackets/Braces Spanish keyboard binds
[
{ "keys": ["´"], "command": "insert", "args": {"characters": "{"} },
{ "keys": ["ç"], "command": "insert", "args": {"characters": "}"} },
{ "keys": ["`"], "command": "insert", "args": {"characters": "["} },
{ "keys": ["+"], "command": "insert", "args": {"characters": "]"} }
]
@eduwass
eduwass / readme.md
Created April 17, 2019 17:43
Zip latest committed changes only

git archive will accept paths as arguments. All you should need to do is:

git archive -o ../latest.zip some-commit $(git diff --name-only earlier-commit some-commit)

or if you have files with spaces (or other special characters) in them, use xargs:

git diff --name-only earlier-commit some-commit | xargs -d'\n' git archive -o ../latest.zip some-commit

If you don't have xargs properly installed, you could cook up an alternative:

@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 / 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;
}