Skip to content

Instantly share code, notes, and snippets.

@gdarko
gdarko / str_contains.php
Last active March 19, 2025 18:09
str_contains() was introduced in PHP8. This is a polyfill for PHP7 or lower.
<?php
if (!function_exists('str_contains')) {
/**
* Check if substring is contained in string
*
* @param $haystack
* @param $needle
*
* @return bool
*/
@erobert17
erobert17 / bootstrap-3-vert-offset-shim.css
Last active May 2, 2022 18:36
Adds a vertical offset top and bottom to Bootstrap 3 to be used within columns. Currently no vertical offset is available as standard in Bootstrap 3.
/*
Include this after bootstrap.css. Add class of
vert-offset-top-value or vert-offset-bottom-value
to your Bootstrap 3 default rows to prevent row content
from touching the row content above or below.
*/
/* Vertical Offset Bottom */
.vert-offset-top-12{
margin-top: 12em;