Skip to content

Instantly share code, notes, and snippets.

View kenhowardpdx's full-sized avatar

Ken Howard kenhowardpdx

View GitHub Profile
@kenhowardpdx
kenhowardpdx / Simple-CSS-Vertical-and-Horizontal-Centering.markdown
Last active December 22, 2015 23:19
Simple CSS Vertical and Horizontal Centering

Simple CSS Vertical and Horizontal Centering

Centering a block horizontally is no problem. Centering an absolute positioned block has its challenges. Vertically centering anything on a page can make you pull your hair out. That is, until now.

A Pen by kenhowardpdx on CodePen.

License.

<?
date_default_timezone_set('America/Los_Angeles');
//Connect to the database
$db_host = "localhost";
$db_user = "dbuser";
$db_pass = "dbpassword";
$db_database = "dbname";
$mysqli = new mysqli($db_host, $db_user, $db_pass, $db_database);
@kenhowardpdx
kenhowardpdx / Remove-Stuff.markdown
Created November 20, 2013 19:46
Remove Stuff (various methods)
@kenhowardpdx
kenhowardpdx / Fibonacci-Graph.markdown
Last active January 3, 2016 15:19
Fibonacci Graph
@kenhowardpdx
kenhowardpdx / WordPress Google Analytics
Last active April 5, 2023 18:00
Add Google Analytics to WordPress Theme functions.php
function init_analytics() {
$analytics = '<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push([\'_setAccount\', \'UA-XXXXXXXX-X\']);
_gaq.push([\'_trackPageview\']);
(function() {
var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;
ga.src = (\'https:\' == document.location.protocol ? \'https://\' : \'http://\') + \'stats.g.doubleclick.net/dc.js\';
@kenhowardpdx
kenhowardpdx / CSS3 - jQuery Animation Demo
Last active January 3, 2016 15:39
CSS3/jQuery Animation Demo
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="ROBOTS" content="NOINDEX,FOLLOW">
<meta name="GOOGLEBOT" content="NOARCHIVE">
<meta http-equiv="PRAGMA" content="NO-CACHE">
@kenhowardpdx
kenhowardpdx / Image Group
Created February 18, 2014 00:47
CSG - Image Group
<style type="text/css">
.grid {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;.
content:"";
display:table;
clear:both;
margin: 0;
@kenhowardpdx
kenhowardpdx / index.html
Created March 14, 2014 19:39
Firebase Chat Client
<!DOCTYPE>
<html>
<head>
<title>Firebase Demo</title>
<script src='https://cdn.firebase.com/v0/firebase.js'></script>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
<style>
em {
@kenhowardpdx
kenhowardpdx / README.markdown
Last active November 5, 2021 08:09
sharelink.js - Share Links on Social Networks