| 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
| # 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 |
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
| 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
| // ==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
| <?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 Disable Gitlab Virtual Scroll At GoReact | |
| // @namespace http://tampermonkey.net/ | |
| // @version 1.0 | |
| // @description Virtual scroll in gitlab is bad. Just disable this feature | |
| // @author Joanthan Gawrych | |
| // @match https://gitlab.goreact.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=goreact.com | |
| // @grant none | |
| // ==/UserScript== |
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
| const findPathByKey = (ob, key) => { | |
| const found = new Set(); | |
| const queue = [{obj: ob, path: []}]; | |
| let pathLength = 0; | |
| while (queue.length > 0) { | |
| const {obj, path} = queue.shift(); | |
| if (pathLength < path.length) { | |
| pathLength = path.length; | |
| console.log(`increasing depth to ${pathLength}, current queue size: ${queue.length}, current found size: ${found.size}`); | |
| } |
Figured out how to undo merge commits. If you have a branch like so:
develop -A--B--C--D--E
\ \
topic 1--2--M--3
And you wanted to remove the merge, checkout topic and run git rebase --onto 2 M, where M is the merge commit and 2 is the topic's commit before the merge commit:
WARNING: THIS DELETES EVIL MERGE CHANGES (changes that do not appear in either parent)
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 Jira Sum Highlighted | |
| // @author Jonathan Gawrych | |
| // @match https://goreact.atlassian.net/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net | |
| // @grant none | |
| // @run-at document-idle | |
| // ==/UserScript== | |
| (function doit() { |