Skip to content

Instantly share code, notes, and snippets.

View jbenesch's full-sized avatar

Jason Benesch jbenesch

View GitHub Profile

Survey-Mart

Thank you for applying to be a part of the Walmart Labs Customer Experience team! A little about our team; We build internal tools that address specific business needs or inefficiencies within the larger Walmart organization. So whether that is helping users curate content on Walmart.com or building systems that help train machine learned algorithms for product recommendations, we are constantly challenged and tasked with building modern solutions to address the every day challenges that arise with running a business in which 95% of US households live within 10 miles of a physical store and which sees 300+ million visitors online a month.

Today we have been asked to provide a solution that will allow the business to quickly and easily gather feedback from customers after in-store purchases. We would like the ability to create ad-hoc surveys that feature a series of questions that will run on touch screen devices in stores and appear after a recent purchase by a customer. These questions will

@jbenesch
jbenesch / example.php
Created November 25, 2016 08:44
Evaluate a string of javascript in php
<?php
echo shell_exec("/usr/local/bin/node ./test.js " . json_encode(array('foo' => 'bar')));
@jbenesch
jbenesch / ssl.sh
Created April 14, 2016 17:38
Self signed SSL certificates and NGINX conf creation.
#!/bin/sh
[ -z "$1" ] && echo "Usage: ssl <hostname>" && exit 1
# Create the certs
rm -rf /mnt/certs/$1
mkdir /mnt/certs/$1
cd /mnt/certs/$1
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
@jbenesch
jbenesch / test.php
Created October 26, 2015 15:51
Simple php inspection
function performance($label) {
$time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
$memory = memory_get_usage();
$functions = get_defined_functions();
echo "<pre>";
echo "LABEL: $label\n";
echo "TIME: $time\n";
echo "MEM: $memory\n";
<html>
<head>
<style>
.lg {
width: 100px;
background-color: blue;
height: 20px;
display: inline-block;
border: 1px black;
}
[alias]
st = status
co = checkout
cob = checkout -b
cp = cherry-pick
up = add -up
c = commit -m
lg = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset - %an (%ae)' --abbrev-commit --date=relative
todo = grep --heading --break --ignore-case -e 'TODO:'
fix = grep --heading --break --ignore-case -e 'FIX:' -e 'FIXME:'
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<h2>Original CSS</h2>
<style style="display: block; white-space: pre; font-family: monospace">
h2 { margin:0; }