Skip to content

Instantly share code, notes, and snippets.

@Convincible
Convincible / form.html
Last active June 7, 2019 14:50
Multiple reCAPTCHAs (v2 Invisible) that run after validation, then send form data over AJAX, using jQuery
<head>
<script src="https://www.google.com/recaptcha/api.js?onload=recaptchaLoad&render=explicit" async defer></script>
</head>
<body>
<form action="?" method="POST" class="form form-ajax">
<label for="form-1-field-message">Message</label>
<textarea name="form-1-field-message" id="form-1-field-message" placeholder="How can we help?" required="required" autocomplete="off" minlength="20" rows="5"></textarea>
@Convincible
Convincible / setup.sh
Last active June 18, 2018 11:46
Commands to run to set up WSL for website development with Jekyll and DatoCMS running on Netlify
#!/bin/bash
# This set of commands to be run after fresh install Ubuntu on Windows
# It is not intended as an actual script to run by itself
# Update OS
sudo apt update
sudo apt upgrade
# NVM (Node Version Manager)
touch ~/.bashrc
@Convincible
Convincible / dato.config.rb
Last active January 14, 2018 19:22
DatoCMS Tree Iteration
def tree_iterate(tree, path)
directory path do
tree.each { |branch|
create_post "#{branch.slug}.md" do
frontmatter :yaml, {
title: branch.title
}
content(branch.body)
end
if (branch.children.length > 0)
@Convincible
Convincible / jsclass.js
Last active October 17, 2017 22:12
Add 'js' class to <html> element
(function(d){d.className=d.className.replace(/(^|\s)no-js(\s|$)/, ' ') + ' js'}(document.documentElement));
@Convincible
Convincible / robots.txt
Last active October 17, 2017 20:16 — forked from budparr/robots.txt
Robots.txt to exclude dev/staging/non-production environments
---
layout: null
---
User-agent: *
Disallow: {% if jekyll.environment != 'production' %}/{% endif %}