Skip to content

Instantly share code, notes, and snippets.

@dennishall
dennishall / jira-user-script.js
Last active August 4, 2021 19:09
UserScript (Tampermonkey) for JIRA - Adds buttons to copy branch name, pull request title to clipboard
// ==UserScript==
// @name Get branch name, get PR title, copy to clipboard
// @namespace http://tampermonkey.net/
// @version 1.0.0
// @description For JIRA. Adds buttons to copy branch name and pull request title to clipboard, adds console helpers.
// @author Dennis Hall
// @match https://*.atlassian.net/*
// @grant none
// ==/UserScript==
project = "MB Vans" AND comment ~ "(x) prod" AND updated >= -3w ORDER BY lastViewed DESC
@dennishall
dennishall / sniffles
Last active December 17, 2015 06:58
Give identifying classnames -- css / styling hooks -- to pages opened by window.open and pages that are iframed.
var _open = window.open;
window.open = function(a,b,c,d,e,f){
var popupHandle = _open(a,b,c,d,e,f);
try {
popupHandle.isPopup = true;
}catch(e){
//for pdf pop-ups
}
return popupHandle;
};
// stream media
// urls to consider:
// http://html5doctor.com/video-canvas-magic/
// http://stackoverflow.com/questions/1106955/php-and-ffmpeg-performing-intelligent-video-conversion
// http://stackoverflow.com/questions/6954845/how-to-create-a-webm-video-file
// http://johndyer.name/ffmpeg-settings-for-html5-codecs-h264mp4-theoraogg-vp8webm/
// http://blog.pcode.nl/2010/10/17/encoding-webm-using-ffmpeg/
@dennishall
dennishall / columnize.js
Created July 9, 2012 18:42
Simple columnize javascript function
function columnize(ul){
var offsetTop = YAHOO.util.Dom.getRegion(ul).top;
var listItems = ul.getElementsByTagName('li');
for(var i=0,l=listItems.length;i<l;i++){
var region = YAHOO.util.Dom.getRegion(listItems[i]);
if(region.bottom - offsetTop > 200){
var clone = ul.cloneNode(true);
// remove all list items that follow this one from the current list. (will be covered by the clone)
for(var j=l-1; j>=i; j--){
ul.removeChild( ul.lastChild );
@dennishall
dennishall / include-exclude-zipcode-ranges.js
Created August 1, 2011 12:42
Include/Exclude zipcode ranges
$('ul.models li.model').each(function(i, node) {
var li = $(node);
// <li data-excludes="88995, 90000-99999">
var includes = li.attr('data-includes').replace(' ', '').split(',');
var excludes = li.attr('data-excludes').replace(' ', '').split(',');
if(!includes.length){
includes = [[0, 99999]];
@dennishall
dennishall / CQ5-wcmmode-toggler-bookmarklet.js
Created July 28, 2011 16:11
Toggle the current page between author and publish mode (if the page is powered by adobe day cq)
javascript:(function(){var a=location,b=/wcmmode=disabled[&]?/,c=a.search,d=c.replace(b,""),e="wcmmode=disabled",f=a.href.replace("/cf#","").replace("?","?"+e);a.href=b.test(a.href)?location.protocol+"//"+location.host+"/cf#"+location.pathname+(d.length?"?"+d:d)+location.hash:b.test(f)?f:f+"?"+e})()
@dennishall
dennishall / LogFilePathAsHTMLComment.java
Created July 19, 2011 15:33
Log JSP Include File Paths as HTML Comments
// replace "projectName" with your actual project name
package com.projectName.filters;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
@dennishall
dennishall / Strip_Trailing_Whitespace.js
Created May 11, 2011 13:26
Strip Trailing Whitespace (Macro for Komodo Edit)
// also available at http://jsfiddle.net/dennishall/UydZn/
var previousIndentation = '';
var indent = " ";
/**
* Standard setup for a method
*
* @param Function callback The content of the script
*/
@dennishall
dennishall / FormAuthStrategy.js
Created May 5, 2011 20:49
connect-auth example
//FormStrategy.js
var fs = require("fs"),
forms = require("forms"),
connect = require('connect'),
url = require('url'),
jsSHA = require('./jsSHA'),
haml = require('hamljs'), // For a higher quality implementation you may want to look at [visionmedia]'s [Jade](http://jade-lang.com) template engine,
mailer = require('mailer'),
// our own libs