Skip to content

Instantly share code, notes, and snippets.

View dprevite's full-sized avatar
🐈

Dan Previte dprevite

🐈
View GitHub Profile
@dprevite
dprevite / gist:3702510
Created September 11, 2012 22:11 — forked from brianseitel/gist:1495488
SimpleXML to Array
function simplexml_to_array($simplexml_object) {
$array = array();
$children = $simplexml_object->children();
$executed = false;
foreach ($children as $elementName => $node) {
if ($array[$elementName] != null) {
if ($array[$elementName][0] !== null) {
$i = count($array[$elementName]);
simplexml_to_array($node, $array[$elementName][$i]);
} else {
@dprevite
dprevite / .vimrc
Last active December 27, 2015 08:29 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@dprevite
dprevite / osx-for-hackers.sh
Last active November 28, 2016 05:43 — forked from brandonb927/osx-for-hackers.sh
My fork of osx-for-hackers.sh
#!/bin/sh
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
# Set the colours you can use
black='\033[0;30m'
find . -type f -iname '*.php' -not -path "./vendor/*" -exec bash -c 'echo $0 && expand -t 2 -i "$0" >"$0.expand.tmp" && mv "$0.expand.tmp" "$0"' {} \;
@dprevite
dprevite / install-comodo-ssl-cert-for-nginx.rst
Created October 24, 2015 18:45 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert