Skip to content

Instantly share code, notes, and snippets.

View asha23's full-sized avatar
🎩
Working from home

Ash Whiting asha23

🎩
Working from home
View GitHub Profile
@asha23
asha23 / import_files.php
Created August 29, 2019 13:17 — forked from teledirigido/import_files.php
Create post, add attachment and update field via ACF
<?php
/*
*
* This small scripts creates a post and attaches a file using Advanced custom field.
*
* Created by Miguel Garrido
* miguel.co.nz | miguel@blacksheepdesign.co.nz
*
* Notes:
@asha23
asha23 / progress.php
Created August 29, 2019 10:06 — forked from mjuhl/progress.php
PHP Output Buffering/JavaScript/CSS Transition Progress Bar Experiment
<?php
/* For AJAX, if frustrated, try the following (see http://www.php.net/manual/en/function.flush.php#91556):
@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0);
*/
ob_start();
set_time_limit(0); // for scripts that run really long
function force_flush ($add_whitespace = TRUE) {
@asha23
asha23 / core-blocks.txt
Created June 17, 2019 10:46 — forked from DavidPeralvarez/core-blocks.txt
Gutenberg core blocks list
// Útil para filtros de Gutenberg como "allowed_block_types"
archives
audio
button
categories
code
column
columns
coverImage
<?php
if(!function_exists('wc_get_products')) {
return;
}
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$ordering = WC()->query->get_catalog_ordering_args();
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby']));
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby'];
@asha23
asha23 / Web_Dev_Contract.md
Last active May 2, 2019 01:55
The latest version of my ‘killer contract’ for web designers and developers

Web Contract

Between [company name]

And [customer name].

Summary:

@asha23
asha23 / gform_stripe_subscriptions.php
Created June 18, 2018 09:35 — forked from saltnpixels/gform_stripe_subscriptions.php
Gravity forms stripe cancel from front end
<?php
/**
* Payment subscriptions and updating billing and cancelling subscriptions takes place with these hooks
* We need the stripe customer user id for updating billing
* we need the entry id of subscription so we can cancel it.
*/
/**
* @param $entry
<select name="time-hours">
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
<option value="5">05</option>
<option value="6">06</option>
<option value="7">07</option>
<option value="8">08</option>
<option value="9">09</option>
@asha23
asha23 / fix-homebrew-npm.md
Created February 4, 2016 16:08 — forked from DanHerbert/fix-homebrew-npm.md
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
@asha23
asha23 / gist:800284348b744b4e1fb1
Last active August 29, 2015 14:25 — forked from kevingessner/gist:9509148
Responsive emails that really work -- From Etsy's Code As Craft blog: http://codeascraft.com/2014/03/13/responsive-emails-that-really-work
<html>
<head>
<style type="text/css">
table table {
width: 600px !important;
}
table div + div { /* main content */
width: 65%;
float: left;
}