Skip to content

Instantly share code, notes, and snippets.

View adrianspeyer's full-sized avatar

Adrian Speyer adrianspeyer

View GitHub Profile
@alison-mk
alison-mk / age-verification.js
Last active June 17, 2023 23:37
Age verification cookie: Check cookie on every page load, display pop up window if no cookie is found. In every instance, set cookie to expire after one day. Live and in action here: http://www.leefoil.com/
ageVerify: function() {
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
function getCookie(cname) {
var name = cname + "=";
@linc
linc / wp vanilla comments conditional
Created October 16, 2012 15:40
Using Vanilla Comments on newer posts only
<?php
if (the_date('U') < strtotime('5 Oct 2012')) { // Where 5 Oct 2012 is the date they switched
/* DEFAULT WORDPRESS COMMENTS TEMPLATE GOES HERE */
} else {
/* VANILLA COMMENTS GOES HERE */
@nu7hatch
nu7hatch / example.html
Created September 7, 2010 14:20
Simple banner rotator with jQuery
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<link href="rotate.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="rotate.js"></script>
<script type="text/javascript">
$(window).load(function() {
startRotator("#rotator");
})
</script>