Skip to content

Instantly share code, notes, and snippets.

View thewhistler1's full-sized avatar

Toby thewhistler1

View GitHub Profile
@thewhistler1
thewhistler1 / getSunday.php
Created February 11, 2020 19:37
Get nearest Sunday's date from date
function getSunday($date) {
$dow = strftime("%A", strtotime($date));
switch ($dow) {
case "Monday";
$date = date ('Y-m-d', strtotime ("$date - 1 days"));
return $date;
case "Tuesday";
$date = date ('Y-m-d', strtotime ("$date - 2 days"));
return $date;
case "Wednesday";
@thewhistler1
thewhistler1 / media.css
Created September 28, 2018 19:45
media
@media only screen and (max-width: 1023px) {
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Document</title>
</head>
<body>
<div style="clear:both"></div>
@thewhistler1
thewhistler1 / spam catcher
Last active August 17, 2018 16:12
Class to catch spam emails
<?php
/**
* SPAM PROTECTION LIBRARY
*
* This library is meant to protect from spammy form submissions.
* It is currently set up for codeigniter but can easily be
* converted to use with any type of system.
*
* @author Toby Taylor
*
@thewhistler1
thewhistler1 / 0_reuse_code.js
Created May 15, 2016 02:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console