Skip to content

Instantly share code, notes, and snippets.

@genedwards
genedwards / pre-commit
Last active September 20, 2021 14:04
Git pre-commit hook to prevent fdescribe et al.
#!/bin/sh
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
# uncomment next line for debugging, will print all expanded bash commands
#set -x
# Yes, if you put "fdescribe" in a comment block, this will still abort the
@genedwards
genedwards / to-app-bookmarklet
Created December 15, 2016 16:23
from ticket to app page
javascript:(
function(){
location.replace(location.href.replace(/api\/api\/.*ticket.*realm.*/,'qbase/apps'));
}()
)
javascript:(
function(){
var url = location.href;
hasParameters = url.indexOf('?') > -1;
hasRelationshipParameter = url.indexOf('relationshipPrototype') > -1;
if (!hasRelationshipParameter) {
if (hasParameters) {
location.replace(url + '&relationshipPrototype=1');
} else {
location.replace(url + '?relationshipPrototype=1');
javascript: (function () {
if (location.href !== 'https://jenkins1.ci.quickbaserocks.com/view/Huey/job/_huey/') {
location.href = 'https://jenkins1.ci.quickbaserocks.com/view/Huey/job/_huey/';
return;
}
const links = Array.from(document.querySelectorAll('#projectstatus .model-link.inside'));
const jobs = links
.filter(
javascript:(
function(){
const userId = location.host.match(/(.*?)\./)[1];
location.replace(`${location.origin}?a=SignIn&loginid=${userId}%40g88.net&password=${userId}`);
}()
)
javascript:(
function(){
const styleRules = `*:focus {
border: 1px solid cornflowerblue !important;
background-color: papayawhip !important;
}`;
const style = document.createElement('style');
style.innerText = styleRules;
document.head.appendChild(style);