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
# List all files with the wrong nameapace. | |
list_php_files_with_wrong_namespace() { | |
git ls-files --cached --modified '*.php' | while read PHP_FILE ; do | |
local EXPECTED_NAMESPACE="$( | |
echo "$PHP_FILE" | \ | |
sed -e 's/^src\///' -e 's/\//\\/g' -e 's/\.php$//' | \ | |
rev | cut -d'\' -f2- | rev | |
)" | |
local NAMESPACE="$(grep '^namespace ' "$PHP_FILE" | cut -d' ' -f2 | sed -e 's/;$//')" |
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
/** | |
* Convert a string to Pascal Case (removing non alphabetic characters). | |
* | |
* @example | |
* 'hello_world'.toPascalCase() // Will return `HelloWorld`. | |
* 'fOO BAR'.toPascalCase() // Will return `FooBar`. | |
* | |
* @returns {string} | |
* The Pascal Cased string. | |
*/ |
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
// ==UserScript== | |
// @name Auto-fill GitHub PR Review Summary | |
// @namespace http://jacksonc.com/ | |
// @version 0.1 | |
// @description Fill the GitHub PR review summary based on the resolution chosen. | |
// @author Jackson Cooper <[email protected]> | |
// @match https://github.com/*/*/pull/*/files | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Remove Drupal's Contextual Destination Parameters | |
// @namespace http://jacksonc.com | |
// @version 1.0 | |
// @description Removes the `?destination=` parameter from Drupal's contextual links. | |
// @author Jackson Cooper <[email protected]> | |
// @grant none | |
// @require https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.18.4/URI.min.js | |
// ==/UserScript== |
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
# Remove dangling commits/blobs. | |
git reflog expire --expire=now --all | |
# Verify connectivity and validity of the DB objects. | |
git fsck --full --unreachable | |
# Cleanup unused branches. | |
git remote | xargs --no-run-if-empty git remote prune | |
# Re-pack repository objects. |
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
/** | |
* Execute a function only once per instance. | |
* | |
* @param {...*} arguments | |
* | |
* @return {*} | |
* The return value of the function's first execution. | |
*/ | |
Function.prototype.once = function() { | |
var _self = this, |
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
// Generated with http://chriszarate.github.io/bookmarkleter/ | |
javascript:!function(){var%20e=document.getElementById(%22key-val%22).text,t=document.getElementById(%22summary-val%22).textContent,a=t.trim().replace(%22+%22,%22and%22).replace(/[^a-z0-9+]+/gi,%22_%22),n=%22feature/%22+e+%22_%22+a;window.prompt(%22Copy%20to%20clipboard%22,n)}(); |
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
// scss-lint:enable DuplicateProperty | |
Linter list: https://github.com/brigade/scss-lint/blob/master/lib/scss_lint/linter/README.md |
NewerOlder