Skip to content

Instantly share code, notes, and snippets.

View dreboard's full-sized avatar

Andre Board dreboard

View GitHub Profile
@dreboard
dreboard / VagrantFile
Created July 26, 2019 06:31
PHP Create Redis and MySql with Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
@script = <<SCRIPT
# Fix for https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1561250
if ! grep -q "ubuntu-xenial" /etc/hosts; then
echo "127.0.0.1 ubuntu-xenial" >> /etc/hosts
fi
@dreboard
dreboard / basic_html5
Created July 24, 2019 17:30
Basic HTML5 Bootstrap Template
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Basic Template</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
@dreboard
dreboard / Vagrantfile-php7.3
Created July 23, 2019 00:48
Vagrantfile PHP 7.3
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
@script = <<SCRIPT
# Fix for https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1561250
if ! grep -q "ubuntu-xenial" /etc/hosts; then
echo "127.0.0.1 ubuntu-xenial" >> /etc/hosts
fi
@dreboard
dreboard / Vagrantfile
Created August 18, 2017 17:46
Install or Update Composer Dependancies On Vagrant Up
# Section to add to Vagrantfile
config.vm.provision "shell", run: "always", inline: <<-SHELL2
echo -e "\n------------------------------------------- Composer install and config\n"
curl -s https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
cd /var/www/dev && php composer.phar install
sudo cp /var/www/dev/dev_ops/git/post-merge.sh /var/www/dev/.git/hooks
SHELL2
@dreboard
dreboard / deploy_branch.sh
Created August 18, 2017 17:35
Deploy Branch To Subdomain
#!/usr/bin/env bash
# Deploy staging branch
# git pull origin staging
echo ".....preparing commands"
vagrant ssh -c "
cd /var/www/staging
if [ -d .git ]; then
echo ......initialize git;
@dreboard
dreboard / connection.php
Last active August 14, 2017 16:54
Install Microsoft MsSql Server Drivers for PHP PDO
try {
$dbh = new PDO("sqlsrv:Server=localhost;Database=mydatabase", "username", "password");
echo "CONNECTED";
} catch (PDOException $e) {
echo "Failed: " . $e->getMessage();
}