Skip to content

Instantly share code, notes, and snippets.

View BlueInkAlchemist's full-sized avatar

Josh Loomis BlueInkAlchemist

View GitHub Profile
@BlueInkAlchemist
BlueInkAlchemist / fetch.php
Created January 8, 2019 20:02
WordPress plugin for API consumption
<?php
/**
* @package WooCommerce API Data Builder
* @version 0.4
*/
/*
Plugin Name: API Data Builder
Description: Creates REST API endpoint & builds the JSON response from the WooCommerce API
Author: Josh Loomis
Version: 0.4
@BlueInkAlchemist
BlueInkAlchemist / Makefile
Created May 18, 2018 01:08
Node Bootstrap Makefile
REPORTER = spec
all: jshint test
test:
@NODE_ENV=test ./node_modules/.bin/mocha --recursive --reporter $(REPORTER) --timeout 3000
jshint:
jshint lib examples test index.js
@BlueInkAlchemist
BlueInkAlchemist / paypal-payout-helper.class.php
Last active June 8, 2018 23:59
WordPress PHP Class facilitating automated PayPal transactions.
<?php
class Paypal_Payout_Helper {
protected static $instance = null;
private function __construct() {
}
public static function get_instance() {
if( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
@BlueInkAlchemist
BlueInkAlchemist / sum_multiples.py
Created April 7, 2018 20:17
Sum all multiples of 3 & 5 up to 1000, using Python
# 1. Get the upper bounds for the arithmetic series.
## Ensure that no limit reaches 1000.
LIMIT=999
upper_for_three = LIMIT // 3
upper_for_five = LIMIT // 5
upper_for_fifteen = LIMIT // 15
# 2. Calculate sums from within individual bounds.
sum_three = 3*upper_for_three*(1 + upper_for_three) / 2
<h1>The results of the function are:</h1>
<p id="fill"></p>