Skip to content

Instantly share code, notes, and snippets.

View ziadoz's full-sized avatar

Jamie York ziadoz

View GitHub Profile
@ziadoz
ziadoz / composer_path.json
Last active August 14, 2024 07:56
Composer Using Local Repositories and Branches
{
"repositories": [
{
"type": "path",
"url": "../relative/project/path"
}
],
"require": {
"${project}": "dev-${branch}"
}
@ziadoz
ziadoz / XmlElement.php
Created August 26, 2015 16:50
Simple XML Element Builder (Proxies to SimpleXMLElement class)
<?php
use \SimpleXMLElement;
use \BadMethodCallException;
class XmlElement
{
/**
* The default XML DOCTYPE.
*
* @var string
@ziadoz
ziadoz / photos.sh
Last active August 24, 2019 19:49
OS X Photos - View Raw Photos in Finder
#!/usr/bin/env bash
# Make the OS X Photos Library viewable as a folder called Raw in ~/Pictures
cd ~/Pictures
mkdir Raw
ln -s ~/Pictures/Photos\ Library.photoslibrary/Masters/ Raw
@ziadoz
ziadoz / fix-samsung-macbook-retina-picture.md
Last active July 12, 2016 21:00
Fix Samsung monitor (T22D390) as external display for a Macbook Pro Retina producing blurry picture

Fix Samsung monitor (T22D390) as external display for a Macbook Pro Retina producing blurry picture

If plugging your Macbook Pro Retina into your Samsung monitor using HDMI is producing a blurry picture with illegible fonts, this is how to fix it.

  1. Switch to the input source that your laptop is connected to.
  2. Press the "Sources" on your remote/monitor.
  3. Navigate to the small square in the top right hand corner of the sources list called "Tools".
  4. Choose the "Edit Name" option for the input source.
  5. Change it to "PC" or "PC DVI"
  6. Enjoy!
@ziadoz
ziadoz / fix-xbox-one-controller-windows-10.md
Last active August 27, 2021 23:32
Fix Xbox One Controller issues after Windows 10 Anniversary update

Fix Xbox One Controller on Windows 10 Anniversary

After the Windows 10 Anniversary update Xbox One Controllers may start showing up as two XInput devices in Steam, and button presses occur twice.

To fix this you need to patch in the xinputhid.sys file from an earlier Windows 7 driver.

Note: This fix only works for connecting the controller via USB cable or USB wireless adapter, the new Bluetooth controller when paired still doesn't work.

Download the Windows 7 Driver

@ziadoz
ziadoz / fix-osx-wifi-battery-drain.md
Last active March 25, 2024 13:42
Fix OSX battery draining on sleep due to wifi activity

Fix OSX battery draining on sleep due to wifi activity

Install SleepWatcher using Homebrew:

sudo chown -R $(whoami) /usr/local
brew update
brew install sleepwatcher

Start the SleepWatcher service:

@ziadoz
ziadoz / raspberry-pi-3.md
Last active December 14, 2016 16:40
Raspberry Pi 3 Setup
@ziadoz
ziadoz / amd-audio-fix.md
Last active September 14, 2016 14:12
Fix AMD HDMI audio lost after monitor standby

Fix AMD HDMI audio lost after monitor standby

The quickest solution to this issue is to disable and then re-enable the AMD High Definition Audio Device in the Device Manager. However it's possible to create a handy desktop shortcut:

Download DevManView and put the files in C:\Program Files\NirSoft.

Create a file called Restart AMD Audio.bat on the desktop with the following contents:

"C:\Program Files\NirSoft\DevManView.exe" /disable_enable "AMD High Definition Audio Device"
@ziadoz
ziadoz / reloadvhosts.sh
Last active January 11, 2017 23:42
Automatically Symlink Virtualhosts
# Symlink web server virtualhost configutions into the sites-enabled directory.
# Usage: reloadvhosts /path/to/websites
# reloadvhosts /path/to/websites *-live.conf
# reloadvhosts /path/to/websites apache2
reloadvhosts() {
local vhost_dir=${1:-/var/www/vhosts}
local conf_name=${2:-*dev.conf}
local web_server=${3:-nginx}
sudo find /etc/$web_server/sites-enabled/ -type l -exec rm {} \;
@ziadoz
ziadoz / install.sh
Last active February 8, 2025 16:04
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`