| Rule | Description |
|---|---|
| Generic.Arrays.ArrayIndent | Ensures that array are indented one tab stop. |
| Generic.Arrays.DisallowLongArraySyntax | Bans the use of the PHP long array syntax. |
| Generic.Arrays.DisallowShortArraySyntax | Bans the use of the PHP short array syntax. |
| Generic.Classes.DuplicateClassName | Reports errors if the same class or interface name is used in multiple files. |
| Generic.Classes.OpeningBraceSameLine | Checks that the opening brace of a class/interface/trait is on the same line as the class declaration. |
| Generic.CodeAnalysis.AssignmentInCondition | Detects variable assignments being made within conditions. |
| Generic.CodeAnalysis.EmptyPHPStatement | Checks against empty PHP statements. |
| Generic.CodeAnalysis.EmptyStatement | This sniff class detected empty statement. |
This file contains hidden or 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 | |
| function findPathToObj($from, $to, $maxLevel = 5): ?string | |
| { | |
| $queue = [[ | |
| 'var' => $from, | |
| 'path' => 'root', | |
| 'level' => 0 | |
| ]]; | |
| $seen = []; |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Fill Out HSA Transfer | |
| // @match https://member.my.healthequity.com/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| let toTransfer = null; |
This file contains hidden or 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* count(max) { | |
| if (max.length === 0) { | |
| yield []; | |
| return; | |
| } | |
| for (let i = 1; i <= max[0]; i++) { | |
| for (const subTree of count(max.slice(1))) { | |
| yield [i].concat(subTree); | |
| } | |
| } |
This file contains hidden or 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
| =CHITEST( | |
| QUERY(QUERY(Data!$A:$K,"SELECT count(B) WHERE "&$A2&" IS NOT NULL GROUP BY "&$A2&" PIVOT "&B$1, 1), "SELECT * OFFSET 1", 0), | |
| MMULT( | |
| QUERY(Data!$A:$K,"SELECT COUNT(B) WHERE "&$A2&" IS NOT NULL GROUP BY "&$A2&" label Count(B) ''", 1), | |
| ARRAYFORMULA(DIVIDE(TRANSPOSE( | |
| QUERY(Data!$A:$K,"SELECT COUNT(B) WHERE "&B$1&" IS NOT NULL GROUP BY "&B$1&" LABEL COUNT(B) ''", 1)), | |
| QUERY(Data!$A:$K,"SELECT COUNT(B) LABEL COUNT(B) ''", 1))) | |
| ) | |
| ) | |
| ) |
This file contains hidden or 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
| # If remerging a revert, do this to get back your changes | |
| git revert revertSha | |
| git reset HEAD~ | |
| git add -A | |
| # And skip to the echo below | |
| # Find the merge-base of an already merged branch | |
| # https://stackoverflow.com/a/4991675/1248889 | |
| diff -u <(git rev-list --first-parent topic) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1 |
I hereby claim:
- I am JonathanGawrych on github.
- I am jonathangawrych (https://keybase.io/jonathangawrych) on keybase.
- I have a public key whose fingerprint is A680 6B2B A7AC FEB9 5CD2 1F37 5E23 FEF2 F8AC 3368
To claim this, I am signing this object:
This file contains hidden or 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 << bit == 1 << (bit % 32) | |
| // 1 << 33 == 2 | |
| // need a structure to represent bit >= 32 | |
| var bit = 32; | |
| [(bit >> 5 == 3) << bit, | |
| (bit >> 5 == 2) << bit, | |
| (bit >> 5 == 1) << bit, | |
| (bit >> 5 == 0) << bit] |
This file contains hidden or 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
| @bottom-left-bg-color: #ff0000; | |
| @top-right-bg-color: #0000ff; | |
| @border-color: #cccccc; | |
| @border-width: 5px; | |
| @slant-angle: 15deg; | |
| @slant-height: 10px; | |
| @slant-anti-aliasing: 20% | |
| @slant-width: tan(@slant-angle) * @slant-height; | |
| @slant-hypotenuse: @slant-height / cos(@slant-angle); |
This file contains hidden or 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
| // see http://stackoverflow.com/questions/109023/ | |
| let simd3 = SIMD.Uint32x4.splat(0x33333333); | |
| let simd5 = SIMD.Uint32x4.splat(0x55555555); | |
| let simd01 = SIMD.Uint32x4.splat(0x01010101); | |
| let simd0F = SIMD.Uint32x4.splat(0x0F0F0F0F); | |
| function popcnt(simd) { | |
| simd = SIMD.Uint32x4.sub(simd, SIMD.Uint32x4.and(SIMD.Uint32x4.shiftRightByScalar(simd, 1), simd5)); | |
| simd = SIMD.Uint32x4.add(SIMD.Uint32x4.and(simd, simd3), SIMD.Uint32x4.and(SIMD.Uint32x4.shiftRightByScalar(simd, 2), simd3)); |