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
// Photoshop Script for Optimizing Images for the Web - Saves images as optimized jpeg | |
// Written by: Livingston Samuel | |
// Version 1.0.0 | |
// Required Adobe Photoshop CS 2 and above | |
//Enable double clicking on Mac Finder & Windows Explorer | |
#target Photoshop | |
//Bring app to front | |
app.bringToFront() |
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
/* IP2Octal.js - converts IP address to Octal format | |
* @author - Livingston Samuel | |
* | |
* @requires - padString.js - http://gist.github.com/275259#file_pad_string.js | |
*/ | |
var IP2Octal = function (ip) { | |
var ipSyntax = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, ipArr, i = 4, result = []; | |
if (ipSyntax.test(ip)) { |
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
/* String.pad.js - String prototype method to pad string with specified character, with defined length | |
* @author - Livingston Samuel | |
*/ | |
String.prototype.pad = function (char, len) { | |
var str = this, l = str.length; | |
if (arguments.length !== 2 || String(char).length !== 1 || str.length >= len) { | |
return str; | |
} |
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
/* IP2Decimal.js - converts IP address to decimal format | |
* @author - Livingston Samuel | |
*/ | |
var IP2Decimal = function (ip) { | |
var ipSyntax = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/, ipArr, i = 4, decVal = 0; | |
if (ipSyntax.test(ip)) { | |
ipArr = ip.split("."); |
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
/* formatCurrency.js - number to currency formatting | |
* @author - Livingston Samuel | |
*/ | |
var formatCurrency = function (num, separator, decimal) { | |
var format_separator = separator || ",", | |
decimal_separator = decimal || ".", | |
parts = parseFloat(num, 10).toString().split(decimal_separator); | |
parts[0] = parts[0].split("").reverse().join("").match(/(\d{1,3})/g).join(format_separator).split("").reverse().join(""); |
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
/* hasFirebug.js, alternate version - detects the activation status of firebug | |
* @author Livingston Samuel | |
*/ | |
var hasFirebug = (function () { | |
return !!(window.console && window.console.firebug) | |
}()); | |
/* | |
hasFirebug => false, if Firebug is not installed or not activated for the current page |
NewerOlder