Skip to content

Instantly share code, notes, and snippets.

View mcwhittemore's full-sized avatar

Matthew Chase Whittemore mcwhittemore

View GitHub Profile
@mcwhittemore
mcwhittemore / about.md
Last active December 26, 2015 00:39
Converts the Price Per to a common system.

The Unoffical Relay Foods Unit Converter

Below is a bookmarklet that will intelegently convert all the simular units on relayfoods.com to a common unit.

How to Use

javascript:(function(){var%20imported=document.createElement('script');imported.src=%22http://bit.ly/realy-foods-convert-units%22;document.head.appendChild(imported);})();
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;
@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();
@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 / 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 / check_links.js
Last active December 16, 2015 02:58
jQuery that reports on the start of all links on a page.
@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..."