Skip to content

Instantly share code, notes, and snippets.

View YupItsZac's full-sized avatar

Zac Brown YupItsZac

View GitHub Profile
@YupItsZac
YupItsZac / Vagrantfile
Last active August 29, 2015 14:16
Vagrant File - Basic
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@YupItsZac
YupItsZac / feedParse.class.php
Last active August 29, 2015 14:11
RSS Parser Class - Basic
<?php
class feedParse {
private $feed;
private $truncate;
private $feedData;
public function __construct($feed, $truncate) {
@YupItsZac
YupItsZac / connectToMySQLPDO.php
Last active August 29, 2015 14:06
Connect to MySQL with PDO
try {
$conn = new PDO('mysql:host=localhost;dbname=myDatabase', $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}