Skip to content

Instantly share code, notes, and snippets.

View jasonmerino's full-sized avatar
👋
Hey there!

Jason Merino jasonmerino

👋
Hey there!
View GitHub Profile
@jasonmerino
jasonmerino / index.html
Created May 17, 2013 15:53
A CodePen by Jason. Coverflow-Esque Gallery
<div class="contain" id="contain"></div>
@jasonmerino
jasonmerino / prepare-commit-msg
Last active March 18, 2019 12:20 — forked from bartoszmajsak/prepare-commit-msg.sh
Prepend branch name to every git commit message unless on master.
#!/bin/sh
#
# Prepend the branch name to the commit message
#
# Add this file as [repo]/.git/hooks/prepare-commit-msg
#
# A couple notes:
# 1. The file must be executable (chmod +x prepare-commit-msg)
# 2. This works on a per-repo basis (unless you follow this guide https://coderwall.com/p/jp7d5q/create-a-global-git-commit-hook)
var productView = function() {
this.data = this.data || {};
return {
set: function(options) {
$.extend(this.data, options);
},
get: function(key) {
@jasonmerino
jasonmerino / ld_mobile_branch.js
Last active August 29, 2015 14:00
LD Branch Build
javascript:(function(){
var b = prompt('Enter branch number.');
if(b !== null){
b = b.length === 3 ? '0' + b : b;
window.location.href='http://mob-'+b+'.mbranch.lightingdirect.com?abtest=off';
}
}());
@jasonmerino
jasonmerino / pull-request-bootstrapper.js
Last active August 29, 2015 14:02
Github Pull Request Bootstrapper
javascript:(function () {
function get(selector) {
try {
return document.querySelector(selector);
} catch(error) {
return {};
}
}
@jasonmerino
jasonmerino / duplicate_id_alerter.js
Last active August 29, 2015 14:02
A bookmarklet to detect multiple ID's on a page
javascript:(function(){
var nodes = document.querySelectorAll('*'),
ids = [],
duplicates = [];
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (node.id !== '') {
if (ids.indexOf(node.id) === -1) {
ids.push(node.id);
} else {
@jasonmerino
jasonmerino / form-populatr.js
Last active August 29, 2015 14:03
Form Populatr Bookmarklet
javascript:(function() {
// create a spec of field's -> values
// note: don't be silly and put actual credit card numbers in here, this is just for testing purposes
var spec = {
'credit-card': '4321 4321 4321 4321',
expiration: '12/23',
cvv: 987
};
for (var id in spec) {
@jasonmerino
jasonmerino / Backbone.Model.prototype.set.js
Last active August 29, 2015 14:04
Extends Backbone.Model.set to conform given properties to the models schema before setting them on the model.
Backbone.Model.prototype.defaultSet = Backbone.Model.prototype.set;
_.extend(Backbone.Model.prototype, {
/**
* Adds schema type casting to models before setting attributes
* @param {Object|String} key The key of the value to set or an object of value pairs
* @param {String|Object} val The value to set or the options object
* @param {Object|undefined} options The options for saving or undefined
*/
@jasonmerino
jasonmerino / jira-testing-instruction-bootstrapper.js
Last active August 29, 2015 14:05
JIRA Testing Instruction Bootstrapper
javascript:(function () {
function getPullRequestUrl() {
return prompt('Enter pull request URL');
}
function getSites() {
return [
'build',
'faucet',
find . -name "*.js" | grep -v node_modules | while read i; do js2coffee "$i" > "${i%.*}.coffee"; done