Skip to content

Instantly share code, notes, and snippets.

@keefo
keefo / bdd-kep.mkd
Created July 8, 2019 01:19 — forked from hh/bdd-kep.mkd
BDD Markdown KEP
@zakhardage
zakhardage / Simple "Captcha" for Shopify
Created July 31, 2014 18:16
Simple "Captcha" for Shopify
// Goes in theme.liquid
{% if template contains 'contact' %}
{{ 'https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js' | script_tag }}
<script type="text/javascript">
$(document).ready(function() {
var n1 = Math.round(Math.random() * 10 + 1);
var n2 = Math.round(Math.random() * 10 + 1);
$("#question").val(n1 + " + " + n2);
$(".contact-form").submit(function (e) {
if (eval($("#question").val()) != $("#answer").val()) {