Skip to content

Instantly share code, notes, and snippets.

View thisjustin's full-sized avatar

Justin McCammon thisjustin

View GitHub Profile
@thisjustin
thisjustin / king soopers
Last active March 8, 2020 16:50
add no bags comment to all king soopers items
function fillOutForms() {
$('.WebBuySimpleAccordion-toggleButton').click();
$('.items-center input[data-qa=cart-page-item-instructions-input]').val('No bags, will bring own');
// TODO need to trigger saving via some sort of keypress or focus event in inputs
}
// fill in mass comments on king soopers items in carts to say you don't want bags instead of clicking in each one individually
(function() {
var script = document.createElement("SCRIPT");
script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js';
@thisjustin
thisjustin / setup.md
Last active August 15, 2016 14:25
Sample Django Setup

Mac OSX

Basics

  1. Install Homebrew - we'll use this to easily install some other dependencies

  2. Install the latest 2.7.X release of python brew install python

  3. Install Postgres brew install postgresql (9.5+)

@thisjustin
thisjustin / stringFormat.js
Created November 22, 2014 19:18
Robust string formatting (like python's .format) for Javascript
/*
* Usage:
* '{0}bar {1}'.format('foo', 'baz') // 'foobar baz'
* 'My name is {name}'.format({name: 'Justin'}) // 'My name is Justin'
*/
String.prototype.format = function () {
var args = arguments;
if(Object.prototype.toString.call(arguments[0]).match(/^\[object (.*)\]$/)[1] === "Object") {