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
/** | |
* This JXA script combines 2 or more images into one using ImageMagick. | |
* | |
* Prerequisite: | |
* 1. Mac Yosemite | |
* 2. ImageMagick | |
* | |
* Steps: | |
* 1. Launch Automator app | |
* 2. Create an Automator service. |
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
@keyframes rotating | |
{ | |
from | |
{ | |
transform: rotate(0deg); | |
-o-transform: rotate(0deg); | |
-ms-transform: rotate(0deg); | |
-moz-transform: rotate(0deg); | |
-webkit-transform: rotate(0deg); | |
} |
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 HistoryList(home) | |
{ | |
var arr = [home]; | |
var ptr = 1; | |
this.push = function(elem) { arr.splice(ptr, arr.length-ptr, elem); ptr = arr.length; return this; } | |
this.moveTo = function(pos) { ptr = Math.min(Math.max(1, pos), arr.length); return this; } | |
this.move = function(steps) { return this.moveTo(ptr + steps); } | |
this.get = function() { return arr[ptr-1]; } | |
} |
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 TSFitImage(img) | |
{ | |
if (!img) return; | |
// get the basic metrics | |
var iw = img.naturalWidth, ih = img.naturalHeight, ww = img.offsetParent.offsetWidth, wh = img.offsetParent.offsetHeight; | |
if (!iw || !ih || !ww || !wh) return; | |
// calculate the scale by fitting image to align container's width and height | |
var sw = ww/iw, sh = wh/ih; |
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 PageOptions (pageKey) | |
{ | |
var values = {}; | |
if (window.localStorage) | |
{ | |
var json = window.localStorage.getItem(pageKey); | |
try | |
{ | |
values = JSON.parse(json); | |
} |
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 PageOptions (pageKey) | |
{ | |
var values = {}; | |
if (window.localStorage) | |
{ | |
var json = window.localStorage.getItem(pageKey); | |
try | |
{ | |
values = JSON.parse(json); | |
} |
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
Date.prototype.format = function(pattern, utc) | |
{ | |
if (!pattern) return pattern; | |
var MonthsShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; | |
var MonthsLong = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; | |
var yyyy = this[utc?'getUTCFullYear':'getFullYear'](); | |
var MM = this[utc?'getUTCMonth' :'getMonth']() + 1; | |
var dd = this[utc?'getUTCDate' :'getDate'](); |
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 TSCenterImage(img) | |
{ | |
if (!img || !img.offsetParent) return; | |
// get the basic metrics | |
var iw = img.naturalWidth, ih = img.naturalHeight, ww = img.offsetParent.offsetWidth, wh = img.offsetParent.offsetHeight; | |
if (!iw || !ih || !ww || !wh) return; | |
// calculate the scale by fitting image to align container's width and height | |
var sw = ww/iw, sh = wh/ih; |
NewerOlder