Skip to content

Instantly share code, notes, and snippets.

View dextermb's full-sized avatar
💭
Thinking of the next big thing

Dexter Marks-Barber dextermb

💭
Thinking of the next big thing
View GitHub Profile
<?php
class Database {
private static $instance = null;
public static function get() {
if(self::$instance === null) {
try {
self::$instance = new PDO('mysql:host=localhost;dbname=site;charset=utf8', 'kraken', 'public');
self::$instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
self::$instance->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
@dextermb
dextermb / default.css
Created September 27, 2016 18:21
boilerplate
* {
position: relative;
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Roboto', sans-serif;
font-weight: 400;
font-size: 12px;
color: #777;
cursor: default;
@dextermb
dextermb / in_arrayi.php
Created October 11, 2016 11:21 — forked from sepehr/in_arrayi.php
PHP: Case-insensitive in_array()
<?php
/**
* Case-insensitive in_array() wrapper.
*
* @param mixed $needle Value to seek.
* @param array $haystack Array to seek in.
*
* @return bool
*/
.clearfix:before,
.clearfix:after {
content: " ";
display: table;
}
.clearfix:after {
clear: both;
}
@dextermb
dextermb / Grid.css
Last active October 19, 2016 07:36
12 column grid
/*
* Grid
*/
.cols {
display: block;
}
.cols > [class*='col-'] {
display: inline-block;
float: left;
@dextermb
dextermb / Slideshow.html
Last active October 15, 2016 19:46
Reactive slideshow v1
<div class="slate slideshow mrg-btm-msv">
<div class="slide" style="background-image:url('../assets/images/landing.jpg');">
<div class="float-box">
<div class="content pull-ver-center">
<h4 class="mrg-btm-med">Project Management</h4>
<h5 class="mrg-btm-lrg">In vestibulum neque in purus condimentum, non mattis tortor lobortis.</h5>
<div class="buttons">
<a class="btn btn-invert mrg-rgt" href="#">Learn more<i class="fa fa-fw fa-angle-right"></i></a>
<a class="btn btn-invert" href="#">Get started<i class="fa fa-fw fa-angle-right"></i></a>
</div>
RewriteEngine On
RewriteBase /
# RewriteCond %{HTTPS} !=on
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [L]
/**
* Flexbox
*/
.flexbox {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
* {
margin: 0;
padding: 0;
position: relative;
box-sizing: border-box;
font-family: 'Roboto', sans-serif;
font-weight: 400;
text-decoration: none;
color: #868e96;
cursor: default;
/**
* Buttons
*/
.btn {
display: inline-block;
padding: 10px 40px;
background: -webkit-linear-gradient(#f8f9fa, #f1f3f5);
background: -moz-linear-gradient(#f8f9fa, #f1f3f5);
background: -o-linear-gradient(#f8f9fa, #f1f3f5);