Skip to content

Instantly share code, notes, and snippets.

View magicmarkker's full-sized avatar

Mark Hunt magicmarkker

  • Philadelphia, PA
View GitHub Profile
@magicmarkker
magicmarkker / unique.js
Created November 12, 2012 19:27
Array Unique
Array.prototype.unique = function() {
var a, i, j, l;
a = [];
l = this.length;
i = 0;
while (i < l) {
j = i + 1;
while (j < l) {
if (this[i] === this[j]) {
@magicmarkker
magicmarkker / confirmbox.js.coffee
Created November 12, 2012 19:24
Rails custom dialog confirm box with twitter bootstrap modal
$.rails.allowAction = (element) ->
message = element.data("confirm")
answer = false
return true unless message
if $.rails.fire(element, "confirm")
myCustomConfirmBox message, element
false
myCustomConfirmBox = (message, element) ->
$('.modal .btn-primary').unbind "click"
$("#dialog-confirm .modal-body").html message