Skip to content

Instantly share code, notes, and snippets.

View chrispappas's full-sized avatar
🚜
Lead Dev @ AgDealer.com

Chris Pappas chrispappas

🚜
Lead Dev @ AgDealer.com
View GitHub Profile
@chrispappas
chrispappas / gist:da15783c1c932f0e07bd
Created August 26, 2014 16:36
Boolean-safe default filter
<?php
class DefaultBooleanFilterExtension extends \Twig_Extension {
public function getFilters() {
return array(
new \Twig_SimpleFilter('defaultBoolean', array($this, 'default_boolean')),
);
}
@chrispappas
chrispappas / gist:ad437612317a8d911e52
Created October 31, 2014 21:33
Fix VirtualBox host only adapter in Windows preventing XDebug sessions
Found at:
http://brianreiter.org/2010/09/18/fix-virtualbox-host-only-network-adapter-creates-a-virtual-public-network-connection-that-causes-windows-to-disable-services/
VirtualBox creates a “VirtualBox Host-Only Network” device which is essentially a loopback adapter for creating network connections between virtual machines and between the host and virutal machines. Unfortunately, it shows up to Windows as an unidentified public network. Connecting to a “public network” ratchets up your firewall and disables network discovery and SMB/CIFS network shares. This is kind of a big side effect of installing some VM software.Fortunately, Windows does have a way to mark a network device as virtual by creating a registry value.
The type of the device. The default value is zero, which indicates a standard networking device that connects to a network. Set *NdisDeviceType to NDIS_DEVICE_TYPE_ENDPOINT (1) if this device is an endpoint device and is not a true network interface that connects to a network. For example,