Skip to content

Instantly share code, notes, and snippets.

View gedex's full-sized avatar
🏠
Working from home

Akeda Bagus gedex

🏠
Working from home
View GitHub Profile
#!/usr/bin/env php
<?php
function err(string $message) {
print( $message );
exit(1);
}
function usage() {
global $argv;
@gedex
gedex / phpcs.xml
Last active September 10, 2020 10:11
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards">
<description>WooCommerce extension PHP_CodeSniffer ruleset.</description>
<!-- Exclude paths -->
<exclude-pattern>tests/</exclude-pattern>
<exclude-pattern>woo-includes/woo-functions.php</exclude-pattern>
<exclude-pattern>woo-includes/class-wc-dependencies.php</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
#!/usr/bin/php
<?php
define( 'SVN_USERNAME', getenv( 'SVN_USERNAME' ) );
define( 'SVN_PASSWORD', getenv( 'SVN_PASSWORD' ) );
define( 'WORKDIR', sys_get_temp_dir() . '/' . uniqid() );
define( 'WORKDIR_ATOMIC', WORKDIR . '/atomic' );
define( 'WORKDIR_SRC', WORKDIR . '/src' );
const ATOMIC_SVN_URL = 'https://woothemes.svn.beanstalkapp.com/woocommerce-atomic-products';
#!/bin/bash
error() {
echo "$1"
exit 1
}
get_transient_names() {
local prefix="_transient_$1*"
local transients="$(wp option list --transients --search="$prefix" --field=option_name)"
118d117
< -ms-transform: rotate(90deg);
124d122
< -ms-transform: rotate(180deg);
130d127
< -ms-transform: rotate(270deg);
136d132
< -ms-transform: scale(-1, 1);
142d137
< -ms-transform: scale(1, -1);
@gedex
gedex / morg.go
Created December 11, 2017 02:46
list of my repos for gembel config.
package main
import (
"context"
"fmt"
"os"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
)
@gedex
gedex / gembel.json
Created December 11, 2017 02:43
My GH labels config for gembel.
{
"labels": [
{
"name": "good first issue",
"color": "5319e7"
},
{
"name": "[Pri] BLOCKER",
"color": "e84d10"
},
@gedex
gedex / custom_rule_cost_distance_shipping.php
Created August 30, 2017 06:31
Override rule cost for distance shipping when destination within 5miles of shop AND order total over $100
<?php
add_filter( 'woocommerce_distance_rate_shipping_rule_cost_distance_shipping', function( $rule_cost, $rule, $distance, $package ) {
$order_total = $package['contents_cost'];
if ( $order_total > 100 && $distance <= 5 ) {
$rule_cost = 0;
}
return $rule_cost;
}, 10, 4 );
<?php
add_filter( 'post_class', function( $classes, $class = '', $post_id = '' ) {
$product = wc_get_product( $post_id );
if ( ! $product ) {
return $classes;
}
if ( class_exists( 'WC_Pre_Orders_Product' ) && WC_Pre_Orders_Product::product_can_be_pre_ordered( $product ) ) {
$classes[] = 'pre-order';

Activate the WooCommerce Stripe Gateway

start_path: /wp-admin/plugins.php?plugin_status=search&s=stripe
tags: fresh-install, pre-checkout

Click Activate under WooCommerce Stripe Gateway plugin.

I see Plugin activated notice and following links displayed under WooCommerce Stripe Gateway: