Skip to content

Instantly share code, notes, and snippets.

View jefferyrdavis's full-sized avatar

jeffery Davis jefferyrdavis

View GitHub Profile
@jefferyrdavis
jefferyrdavis / gist:5992107
Last active December 19, 2015 17:29
Snippit: CSS - Clearfix, contain floats
/* (From HTML 5 Boilerplate)
* Clearfix: contain floats
*
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* `contenteditable` attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that receive the `clearfix` class.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
@jefferyrdavis
jefferyrdavis / gist:5992141
Last active December 19, 2015 17:38
Snippit: CSS: Fixed location footer
#footer {
position:fixed;
left:0px;
bottom:0px;
height:30px;
width:100%;
background:#999;
}
@jefferyrdavis
jefferyrdavis / gist:5992151
Last active December 19, 2015 17:38
Snippit: CSS: Listing of CSS Font Families
/*Listing of common CSS font Families*/
.fontFamilyList {
font-family: Arial, Helvetica, sans-serif;
font-family: 'Arial Black', Gadget, sans-serif;
font-family: 'Bookman Old Style', serif;
font-family: 'Comic Sans MS', cursive;
font-family: Courier, monospace;
font-family: 'Courier New', Courier, monospace;
font-family: Garamond, serif;
@jefferyrdavis
jefferyrdavis / gist:5992169
Created July 13, 2013 20:49
Snippit: CSS: Reset
@charset "UTF-8";
/* CSS Document */
/* Reset CSS Start */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
@jefferyrdavis
jefferyrdavis / gist:5992179
Last active December 19, 2015 17:38
Snippit: CSS: Blank CSS Page
@charset "UTF-8";
/* CSS Document */
/* default tags - start */
/* default tags - end */
/* section 1 - start */
@jefferyrdavis
jefferyrdavis / gist:5992194
Last active December 19, 2015 17:38
Snippit: PHP: CSS: Make your CSS Document into a PHP Doc
/*Add the folowing code to the top of the CSS file (with a .php extension) to tell the browser it's actually a PHP file.*/
<?php header("Content-type: text/css; charset: UTF-8"); ?>
@jefferyrdavis
jefferyrdavis / gist:5992211
Last active December 19, 2015 17:38
Snippit: PHP: Hardcore Encryption Function
<?php
// f(ucking) u(ncrackable) e(ncryption) function by BlackHatDBL (www.netforme.net)
function fue($hash,$times) {
// Execute the encryption(s) as many times as the user wants
for($i=$times;$i>0;$i--) {
// Encode with base64...
$hash=base64_encode($hash);
// and md5...
$hash=md5($hash);
@jefferyrdavis
jefferyrdavis / gist:5992218
Last active September 20, 2022 08:10
Snippit: PHP: Detect User Location by IP (Returns City and State)
<?php
// returns "City, State" if found otherwise defaults to "Unkown Location"
function detect_city($ip) {
$default = 'Unkown Location';
if (!is_string($ip) || strlen($ip) < 1 || $ip == '127.0.0.1' || $ip == 'localhost')
$ip = '8.8.8.8';
$curlopt_useragent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)';
@jefferyrdavis
jefferyrdavis / gist:5992224
Created July 13, 2013 21:10
Snippit: PHP: Get Client IP Address
<?php
// Used to determine the IP address of the client.
function GetIpAddr()
{
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
@jefferyrdavis
jefferyrdavis / gist:5992247
Created July 13, 2013 21:16
Snippit: PHP: Validate e-mail to RFCs 5321, 5322 and others.
<?php
/*
Use To validate an email address according to RFCs 5321, 5322 and others.
--------------------------------------------------------------------------------
How to use is_email()
--------------------------------------------------------------------------------
1. Add the downloaded file is_email.php to your project
2. In your scripts use it like this: