Skip to content

Instantly share code, notes, and snippets.

View smayzes's full-sized avatar

Shawn Mayzes smayzes

View GitHub Profile
@smayzes
smayzes / gist:76a802283ed11f7bd1f8e116f4a6dc62
Created December 1, 2018 15:51 — forked from ulrikkold/gist:6893632472eb07a8b15b
Using composer.json with private repositories (without using Packagist)
This is mostly a note to my own bad memory. I hope somebody else can use it, too.
When using composer to manage packages, and one or more of these packages (including the root project itself) is not registered on Packagist, then you must include an entry in the "repositories" array in your composer.json.
I am pretty sure this must be noted somewhere in the documentation, but I was not able to find it.
Example:
{
"name": "vendor/PackageA",

PHP

'123abc' == 123 // True
'123abc' === 123 // False

echo true;		// 1
echo false;		// blank return
@smayzes
smayzes / uri.js
Last active August 29, 2015 14:27 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"