Skip to content

Instantly share code, notes, and snippets.

Jamie York ziadoz

Block or report user

Report or block ziadoz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ziadoz / include-me-func.php
Last active Aug 24, 2019
Prevent Variable Leakage In PHP Includes
View include-me-func.php
// Use a closure so nothing leaks out when included.
return (function () {
$array = ['foo', 'bar'];
foreach ($array as $string) {
// Some exciting logic.
return 'FOOBAR';
ziadoz / .php_cs.dist
Last active Aug 8, 2019
PHP CS Fixer Configuration
View .php_cs.dist
<?php declare(strict_types=1);
$finder = PhpCsFixer\Finder::create()
return PhpCsFixer\Config::create()
'@PSR2' => true,
ziadoz / OpenStruct.php
Last active Aug 2, 2019
OpenStruct and Struct in PHP
View OpenStruct.php
class OpenStruct extends ArrayObject
public function __construct($input = array())
parent::__construct($input, static::ARRAY_AS_PROPS);
public function offsetSet($key, $value)
ziadoz / gists.go
Created Jul 26, 2019
Test Golang API Client Using httptest Package
View gists.go
package gists
import (
type Api struct {
client *http.Client
ziadoz / .bash_profile
Last active Jul 14, 2019
Simple Bash Colours With TPut
View .bash_profile
# See:
BOLD="$(tput bold)"
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
MAGENTA="$(tput setaf 5)"
CYAN="$(tput setaf 6)"
WHITE="$(tput setaf 7)"
ziadoz / stripe-checkout.html
Last active Jun 24, 2019
Custom Stripe Checkout Button
View stripe-checkout.html
<form action="." method="post">
<noscript>You must <a href="" target="_blank">enable JavaScript</a> in your web browser in order to pay via Stripe.</noscript>
value="Pay with Card"
data-name="Example Company Inc"
ziadoz / game-save-clean-up.go
Created May 26, 2019
Clean Up Game Save Manager Folders
View game-save-clean-up.go
// Usage: game-save-clean-up --src="/Files/Game Saves" [--limit=2] [--dryrun]
package main
import (
ziadoz / jquery-capture-css3-transition-end-event.js
Created Jul 9, 2012
jQuery Capture CSS3 Transition End Event
View jquery-capture-css3-transition-end-event.js
$(document).ready(function() {
$('div').on('transitionend MSTransitionEnd webkitTransitionEnd oTransitionEnd', function(event) {
// Do stuff after transition
ziadoz /
Last active May 3, 2019
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 /
Created Jul 22, 2017
Using XDebug in Atom Editor

Using XDebug in Atom Editor

Install the XDebug plugin for Atom and then add the following to the config.cson file (Atom > Config…):

  PathMaps: [
  ServerPort: 9001
You can’t perform that action at this time.