Skip to content

Instantly share code, notes, and snippets.

View andrewstobbe's full-sized avatar

Andrew Stobbe andrewstobbe

  • Parker, Colorado
View GitHub Profile

Homebrew Install Apache with PHP and MySQL on OSX

Setup a local Apache + PHP + MySQL + DnsMasq + PHPSwitcher environment using Homebrew on Mac OSX High Sierra that supports multiple versions of PHP and a self signed SSL certificate.

Install HomeBrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"	
brew doctor
brew update
@andrewstobbe
andrewstobbe / RestClient.php
Last active November 23, 2022 21:12
PHP RestClient
<?php
/**
* Class RestClient
*/
class RestClient
{
private $curl;
private $url;
<?php
/*
* This file is part of Status.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Status\Integrations\GitHub;
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Class Account
*/
class Account
{
private $account_id;
private $email;
@andrewstobbe
andrewstobbe / MacOSXSierra:Brew+Apache+Mysql+PHPSwitcher+DNSMasq+SSL.md
Last active July 19, 2021 02:12
Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL

Mac OSX Sierra : Brew Apache + Mysql + PHP Switcher + DNSMasq + SSL 👍

Things I had to do using Homebrew to get my local web dev environment back up and running after migration to OSX Sierra + Xcode 8.1.

Note: I used brew reinstall because I had already installed most of this previously under Yosemite. Probably better ways to do this, but this is what worked for me.

brew doctor

brew tap homebrew/dupes
brew tap homebrew/versions
@andrewstobbe
andrewstobbe / HomebrewApache2.4.txt
Last active November 4, 2016 21:59
Migrate LAMP via brew Yosemite to Sierra
I have already removed existing versions... then.
brew doctor
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/php
brew tap homebrew/apache
brew update
@andrewstobbe
andrewstobbe / longPolling.js
Created March 25, 2016 17:34 — forked from jasdeepkhalsa/longPolling.js
Simple Long Polling Example with JavaScript and jQuery by Tian Davis (@tiandavis) from Techoctave.com (http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery)
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast)
(function poll(){
$.ajax({ url: "server", success: function(data){
//Update your dashboard gauge
salesGauge.setValue(data.value);
}, dataType: "json", complete: poll, timeout: 30000 });
})();
$(document).ready(function () {
$('#password').keyup(function () {
$('#result').html(checkStrength($('#password').val()));
});
$('#password_confirmation').keyup(function () {
$('#confirm_result').html(checkMatch($('#password').val(), $('#password_confirmation').val()));
});
@andrewstobbe
andrewstobbe / .htaccess
Created March 12, 2015 23:17
A full .htaccess file
# Password protect this directory
# ==========================================
# AuthType Basic
# AuthName "Restricted Area"
# AuthUserFile /etc/httpd/conf/.htpasswd
# require valid-user
# Make PHP code look like other code types
# AddType application/x-httpd-php .asp .py .pl
@andrewstobbe
andrewstobbe / header-meta
Created March 12, 2015 23:13
Meta tags for html head
<head>
<meta charset="utf-8">
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!--[if IE]><meta http-equiv="x-ua-compatible" content="IE=9" /><![endif]-->
<meta name="handheldfriendly" content="true" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />