This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PHP5 Three way comparison | |
* | |
* PHP7 This wouldn't be needed, instead you would do something along the lines of - | |
* if/switch ($left <=> $right) { ... } | |
* | |
* @param integer $left | |
* @param integer $right |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Test to see if string contains ALL needles | |
* | |
* @param array $needles | |
* @param string $haystack | |
* | |
* @return boolean | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* PHP's inbuilt array_unique sucks, here's a significantly faster replacement for it | |
* | |
* @param array $array | |
* | |
* @return array | |
*/ | |
function array_unique_fast($array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get all values from specific key in a multidimensional array | |
* | |
* @param string $key key(s) of value you wish to extract | |
* @param array $arr where you want | |
* | |
* @return null|string|array | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assume we are in your home directory | |
cd ~/ | |
# Clone the repo from GitLab using the `--mirror` option | |
$ git clone --mirror [email protected]:mario/my-repo.git | |
# Change into newly created repo directory | |
$ cd ~/my-repo.git | |
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"directory": "src/_lib", | |
"json": "bower.json" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1<sup>1</sup>⁄<sub>2</sub> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -sL https://github.com/user-or-org/repo/archive/sha1-or-ref.tar.gz | tar xz | |
Replace user-or-org, repo, and sha1-or-ref accordingly. | |
If you want a zip file instead of a tarball, specify .zip instead of .tar.gz suffix. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ClickRegister(global, parent, debug) { | |
var parent = parent || document, | |
debug = !!debug, | |
register = []; | |
var action = function (event) { | |
var target = event.target || event.srcElement; | |
if (debug) { | |
console.group("click register debugging"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<ruleset name="MyStandard"> | |
<description>PSR2 with tabs instead of spaces.</description> | |
<arg name="tab-width" value="4"/> | |
<rule ref="PSR2"> | |
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/> | |
</rule> | |
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/> | |
<rule ref="Generic.WhiteSpace.ScopeIndent"> | |
<properties> |
OlderNewer