Skip to content

Instantly share code, notes, and snippets.

View Geolim4's full-sized avatar
🇺🇦
💕🇫🇷

Georges.L Geolim4

🇺🇦
💕🇫🇷
View GitHub Profile
@Geolim4
Geolim4 / patmatch.php
Created April 11, 2015 23:44
Simple wildcard pattern matching function, using built-in preg_match
function match_wildcard( $wildcard_pattern, $haystack ) {
$regex = str_replace(
array("\*", "\?"), // wildcard chars
array('.*','.'), // regexp chars
preg_quote($wildcard_pattern)
);
return preg_match('/^'.$regex.'$/is', $haystack);
}
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>