Skip to content

Instantly share code, notes, and snippets.

View cyberwombat's full-sized avatar
🙄
Coding away the moments that make up a dull day

Yashua cyberwombat

🙄
Coding away the moments that make up a dull day
View GitHub Profile
<?php
class WC_XMP_Request
{
/*
* Perform CURL request
*/
public static function request($url, $params = array(), $apiKey = null)
{
import merge from 'deepmerge'
import {
DispatchAttributes,
WorkflowDefinition,
WorkflowModel
} from 'typings/workflow'
import { ActionEvent } from 'typings/lambda'
import {
APIGatewayProxyWithCognitoAuthorizerEvent,
AttributeValue,
@cyberwombat
cyberwombat / WooOffers
Created April 7, 2020 19:12
$post conflict resolution
public function add_meta_box_product_offers_callback($post)
{
$product_id = $post->ID;
$args = array(
'post_type' => 'woocommerce_offer',
'post_status' => array('publish', 'accepted-offer', 'countered-offer', 'buyercountered-offer', 'on-hold-offer', 'expired-offer', 'declined-offer'),
'posts_per_page' => -1,
'meta_key' => 'offer_product_id',
'meta_value' => $product_id,
'meta_compare' => '==',
@cyberwombat
cyberwombat / gist:cba15f923c8e44bfa51f927323f8c670
Created November 5, 2018 18:29
FastSpring supported SSL ciphers
Cipher# 0 : TLS_RSA_WITH_AES_256_CBC_SHA256
Cipher# 1 : TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
Cipher# 2 : TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
Cipher# 3 : TLS_RSA_WITH_AES_256_CBC_SHA
Cipher# 4 : TLS_DHE_RSA_WITH_AES_256_CBC_SHA
Cipher# 5 : TLS_DHE_DSS_WITH_AES_256_CBC_SHA
Cipher# 6 : TLS_RSA_WITH_AES_128_CBC_SHA256
Cipher# 7 : TLS_DHE_RSA_WITH_AES_128_CBC_SHA256
Cipher# 8 : TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
Cipher# 9 : TLS_RSA_WITH_AES_128_CBC_SHA
@cyberwombat
cyberwombat / base64.txt
Created October 25, 2017 22:25
base64 Font
T1RUTwAKAIAAAwAgQ0ZGIKomfKYAAAl0AABh1E9TLzJpNAVNAAABEAAAAGBjbWFwzFTwSwAAA9gAAAV8aGVhZIrevHgAAACsAAAANmhoZWGDPn/nAAAA5AAAACRobXR4VlH8fQAAa0gAAAK0bHRhZ2V+AAQAAG38AAAAEm1heHAArVAAAAABCAAAAAZuYW1lYZCvBQAAAXAAAAJocG9zdAADAAAAAAlUAAAAIAABAAAAAQAAYqnXfF8PPPUAAwPoAAAAANYWvGkAAAAA1ha8af+Z/4uAAQM7AAAAAwACAAAAAAAAAAEAAAM7/zgAAIAB/5kAAIBoAAEAAAAAAAAAAAAAAAAAAACtAABQAACtAAAAAwH6AZAABQAAAooCuwAAAIwCigK7AAAB3wAxAQIAAAAAAAAAAAAAAACAAAAnAAAACAAAAAAAAAAAWFhYWABAACAhIgM7/zgAAAM7AHUAAAABAAAAAAG8AkQAIAAgAAAAAAASAN4AAAAEAAAAAAB8AAAAAQAAAAAAAQAIAHwAAQAAAAAAAgAHAJQAAQAAAAAAAwAmAKkAAQAAAAAABAAIAHwAAQAAAAAABQAlARsAAQAAAAAABgAIAHwAAQAAAAAAEAAIAHwAAQAAAAAAEQAHAJQAAwABBAkAAAB8AAAAAwABBAkAAQAQAIQAAwABBAkAAgAOAJsAAwABBAkAAwBMAM8AAwABBAkABAAQAIQAAwABBAkABQBKAUAAAwABBAkABgAQAIQAAwABBAkAEAAQAIQAAwABBAkAEQAOAJsAqQAxADkAOQA5ACAARQB0AGgAYQBuACAARAB1AG4AaABhAG0AICAQACAARgBvAG4AdABoAGUAYQBkACAARABlAHMAaQBnAG4AICAQACAAaAB0AHQAcAA6AC8ALwB3AHcAdwAuAGYAbwBuAHQAaABlAGEAZAAuAGMAbwBtQ3Jvd0JlYWsAQwByAG8AdwBCAGUAYQBrUmVndWxhcgBSAGUAZwB1AGwAYQByTWFjcm9tZWRp
@cyberwombat
cyberwombat / gist:f2b8e15618f732ee543e95efe34a28bd
Last active October 24, 2017 21:29
4xx handling with various HTTP client libs for node
// request-promise-native
const body = request({ url: url, json: true })
const res = await t.throws(body);
console.log(res.error)
// node-fetch
const body = await fetch(url)
console.log(await body.json())
// Find all files which contain 'blah' from current dir
find . -type 'f' -exec grep -H 'blah' {}\;
@cyberwombat
cyberwombat / api.js
Created November 13, 2016 23:28
Walmart API authentication in Node
import { createSign, randomBytes } from 'crypto'
import axios from 'axios'
import { resolve } from 'url'
const PK_HEADER = '\n-----BEGIN PRIVATE KEY-----\n'
const PK_FOOTER = '\n-----END PRIVATE KEY-----\n'
const BASE_URL = 'https://marketplace.walmartapis.com/'
const WALMART_CONSUMER = "b68d2a72....";
@cyberwombat
cyberwombat / test.php
Last active August 30, 2016 08:12
preg_replace
<?php
$html =
"<div class=\"row home-pg-feed-item pl0 pr0 ml0 mr0\" data-type=\"video\">" .
"<div class=\"col-lg-4 col-xs-4 pl0\">" .
"<a href=\"/clinical-dialogue.php?v={{ url }}\"><img src=\"{{ thumb-sm }}\" alt=\"img\"/></a>" .
"</div>" .
"<div class=\"col-lg-8 col-xs-8 pr0 \">" .
"<h4 class=\"mb5\">{{ title }}</h4>" .
"<a href=\"/clinical-dialogue.php?v={{ url }}\" class=\"watch-link\">Watch the video</a>" .
"<p>{{ summary }}</p>" .
@cyberwombat
cyberwombat / bootstrap-4.0.0-alpha.3.min.css
Created August 20, 2016 07:29
Bootstrap 4 alpha with Flex
/*!
* Bootstrap v4.0.0-alpha.3 (http://getbootstrap.com)
* Copyright 2011-2016 The Bootstrap Authors
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v4.0.0 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relati