Skip to content

Instantly share code, notes, and snippets.

@jeffstieler
jeffstieler / manage-jetpack-charging.sh
Created May 1, 2022 16:19
Control smart plug based on Jetpack's battery level
#!/bin/bash
date
mifi_status_url="http://192.168.5.1/srv/status"
mifi_charge_threshold=15
mifi_full_charge=100
plug_name="Jetpack-Plug"
echo "Finding plug IP address..."
@jeffstieler
jeffstieler / stock-report.patch
Created July 15, 2021 16:09
Proposed stock report export fix
diff --git a/src/API/Reports/Stock/Controller.php b/src/API/Reports/Stock/Controller.php
index 0d50517e8..d662df4d8 100644
--- a/src/API/Reports/Stock/Controller.php
+++ b/src/API/Reports/Stock/Controller.php
@@ -32,6 +32,20 @@ class Controller extends \WC_REST_Reports_Controller implements ExportableInterf
*/
protected $rest_base = 'reports/stock';
+ /**
+ * Registered stock status options.
<?php
/**
* Plugin Name: WooCommerce Calypso Bridge Helper
* Plugin URI: https://woocommerce.com
* Description: Utility to assist testing wc-calypso-bridge locally
* Author: WooCommerce
* Version: 0.1
*/
function woocommerce_ecommplan_helper_handler() {
@jeffstieler
jeffstieler / ipfw bandwidth throttle.sh
Created November 16, 2017 03:21 — forked from ardell/ipfw bandwidth throttle.sh
ipfw bandwidth throttling
#!/bin/sh
#
# Use ipfw to throttle bandwidth.
# usage:
# ./throttle.sh # Throttle at default (60KB/s)
# ./throttle.sh 5 # Throttle at custom speed (5KB/s)
# ./throttle.sh off # Turn throttling off
# flush rules
ipfw del pipe 1
@jeffstieler
jeffstieler / dev-wcs.php
Created October 4, 2017 23:21
WCS Dev Plugin
<?php
/*
Plugin Name: WCS Dev
Plugin URI: http://wordpress.org/plugins/
Description: Points WCS @ Staging
Author: Jeff Stieler
Version: 0.1
Author URI: http://zombo.com
*/
@jeffstieler
jeffstieler / gist:00f6a166c8b38202c988
Created June 17, 2015 17:58
Janrain change validation message (hack)
janrain.events.onCaptureValidationFailed.addHandler(function(obj) {
if ( ( 'capture_traditionalRegistration_emailAddress' == obj.field.id ) && ( 'Email address is already being used.' === obj.message ) ) {
jQuery( obj.field ).siblings( 'div.capture_tip_error' ).text( 'Totally in use dude.' );
}
});
@jeffstieler
jeffstieler / gist:3d84fa5468c7eadb7685
Created April 7, 2015 04:13
Testing restify-cache
var request = require('request'),
restify = require('restify'),
cheerio = require('cheerio'),
cache = require('restify-cache');
// cache.config({
// 'ttl': 60
// });
var server = restify.createServer();
@jeffstieler
jeffstieler / dabc-api-server.js
Created March 22, 2015 07:58
Restify Utah DABC Inventory API proof of concept
var request = require('request'),
restify = require('restify'),
cheerio = require('cheerio'),
cache = require('restify-cache');
var server = restify.createServer();
server.use(cache.before);
server.on('after', cache.after);
Index: object-cache.php
===================================================================
--- object-cache.php (revision 776128)
+++ object-cache.php (working copy)
@@ -208,10 +208,7 @@
$mc =& $this->get_mc($group);
if ( isset($this->cache[$key]) && ( !$force || in_array($group, $this->no_mc_groups) ) ) {
- if ( is_object( $this->cache[$key] ) )
- $value = clone $this->cache[$key];
Ideas for adding undo to Movement:
Create AppController :: setAppLocations:(NSArray *) something like:
- (void)setAppLocations:(NSArray *)appLocations
{
for each array in appLocations:
clear app screen