This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var table = $('<table border=1>'), | |
row; | |
for(var i = 0; i < 5; i++) { | |
row = $('<tr>'); | |
row.append($('<td>', {html: 'cell1'})) | |
.append($('<td>', {html: 'cell2'})); | |
table.append(row); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getQueryString = function(str) { | |
return str.slice(1).split("&").reduce(function(o,n){n=n.split('=');o[n[0]]=n[1];return o},{}); | |
}; | |
var hash = getQueryString(document.location.hash); | |
var qs = getQueryString(document.location.search); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var padZero = function(v) { | |
return ('0'+v).split('').reverse().splice(0,2).reverse().join(''); | |
} | |
// OR | |
var padZero = function(v){ | |
return ('0'+v).substr(-2); | |
} | |
padZero(6) // 06 | |
padZero(13) // 13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(window) { | |
debug = (debug === undefined ? false: true); | |
var filterLogBy = localStorage.getItem('filterLog'); | |
filterLogBy = filterLogBy ? JSON.parse(filterLogBy) : []; | |
var filterLog = function() { | |
var remove = function(item) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isRetina = function() { | |
var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\ | |
(min--moz-device-pixel-ratio: 1.5),\ | |
(-o-min-device-pixel-ratio: 3/2),\ | |
(min-resolution: 1.5dppx)"; | |
return (window.devicePixelRatio > 1 || (window.matchMedia && window.matchMedia(mediaQuery).matches)) | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Allow from any origin | |
if (isset($_SERVER['HTTP_ORIGIN'])) { | |
$originUrl = parse_url($_SERVER['HTTP_ORIGIN']); | |
$originHost = $originUrl['host']; | |
// Only match yourdomain.com | |
if( preg_match("/(.*?)\.premii.com/", $originHost)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
names: ["pick-color", "grab-color", "gc"], | |
icon: "chrome://ubiquity/skin/icons/color_wheel.png", | |
description: "Easily pick any color from the page", | |
help: "Command: pick-color or pick-color hex<br>Launch grab color ubiquity, pick any color using mouse, click to copy color value(RGB) to your clipboard. Pick hex using 'pick-color hex'", | |
author: {name: "Dharmesh Patel", email: "dharmesh+ubiquity@gmail.com"}, | |
license: "GPL", | |
homepage: "http://premii.com/", | |
arguments: [{role: 'object', nountype: noun_arb_text}], | |
preview: function preview(pblock, args) { |