Skip to content

Instantly share code, notes, and snippets.

View mcwhittemore's full-sized avatar

Matthew Chase Whittemore mcwhittemore

  • Till
  • Yarmouth, ME
View GitHub Profile
@mcwhittemore
mcwhittemore / ReadMe.md
Last active December 22, 2020 19:32
Bookmarklet to let you post highlighted text to twitter. Slightly moded version of http://jsfiddle.net/dKaJ3/2/. Encoded via http://chris.zarate.org/bookmarkleter.

How to Install

Chrome

  1. Right click on bookmark bar (ctrl+shirt+b to disply if hidden)
  2. Click "Add Page..."
  3. Change Name to "Tweet Highlight"
  4. Change URL to the string of text found in TweetHighlight.bm
  5. Click Save
@mcwhittemore
mcwhittemore / Bookstrap.js
Last active December 12, 2015 05:48
Bootstrap jQuery plugin
;(function($, window, document, undefined) {
var namespace = "myPlugin";
var methods = {
init: function(options){}
}
$.fn[namespace] = function( method ) {
// Method calling logic
@mcwhittemore
mcwhittemore / Readme.md
Created March 22, 2013 18:50
This is a bookmarklet that does what the title implies. Follow the directions below to add it to chrome and then just click the button when you're bothered by their dumb signup popup.

Remove Foreign Policy Signup Overlay

This is a bookmarklet that does what the title implies. Follow the directions below to add it to chrome and then just click the button when you're bothered by their dumb signup popup.

How to Install

Chrome

  1. Right click on bookmark bar (ctrl+shirt+b to disply if hidden)
  2. Click "Add Page..."
@mcwhittemore
mcwhittemore / check_links.js
Last active December 16, 2015 02:58
jQuery that reports on the start of all links on a page.
@mcwhittemore
mcwhittemore / stretch-goal.css
Last active December 17, 2015 01:29
Stretch Goal Display Code For Kickstarter
#custom-sg {
padding: 15px;
background-color: #efefef;
}
#sg-progress {
height: 12px;
background-color: #cccccc;
border-radius: 25px;
}
@mcwhittemore
mcwhittemore / format_number_into_curency.js
Last active December 17, 2015 02:09
Javascript Validators and Formatters
//FROM: http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript
Number.prototype.formatMoney = function(c, d, t){
var n = this,
c = isNaN(c = Math.abs(c)) ? 2 : c,
d = d == undefined ? "." : d,
t = t == undefined ? "," : t,
s = n < 0 ? "-" : "",
i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "",
j = (j = i.length) > 3 ? j % 3 : 0;
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
@mcwhittemore
mcwhittemore / jira.greenhopper.swimlane.mods.js
Last active December 17, 2015 07:59
Expand and collapse GH detail column
var getColumn = function(id){
var out = {};
out.header = $(".ghx-column[data-id='"+id+"']");
out.lane = $(".ghx-column[data-column-id='"+id+"']");
return out;
}
var detailSlide = function(e){
e.preventDefault();
var hideShow = function(opts){
var stories = document.querySelectorAll(".current .story");
for(var i=0; i< stories.length; i++){
if(opts.conditionType=="owner"){
var owner = stories[i].querySelectorAll(".owner")[0];
owner = owner == undefined ? "NONE" : owner.innerText;
if(owner == opts.compare || opts.compare == "ALL"){
stories[i].style.display = opts.display;