This file contains 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
<cfscript> | |
function convertQueryToStructArray( q ) { | |
var result = []; | |
for ( var row in arguments.q ) { | |
result.append( row ); | |
} | |
return result; | |
} |
This file contains 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 getRootWebSitePath() { | |
var _location = document.location.toString(); | |
var applicationNameIndex = _location.indexOf('/', _location.indexOf('://') + 3); | |
var applicationName = _location.substring(0, applicationNameIndex) + '/'; | |
var webFolderIndex = _location.indexOf('/', _ | |
location.indexOf(applicationName) + applicationName.length); | |
var webFolderFullPath = _location.substring(0, webFolderIndex); | |
return webFolderFullPath; | |
} |
This file contains 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
Math.round = (function() { | |
var originalRound = Math.round; | |
return function(number, precision) { | |
precision = Math.abs(parseInt(precision)) || 0; | |
var multiplier = Math.pow(10, precision); | |
return (originalRound(number * multiplier) / multiplier); | |
}; | |
})(); | |
/* | |
example usage: |
This file contains 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
Show hidden characters
{ | |
"Seti_SB_bright": true, | |
"Seti_SB_med": true, | |
"Seti_no_bar_undertabs": true, | |
"Seti_tabs_small": true, | |
"always_show_minimap_viewport": true, | |
"auto_complete_triggers": | |
[ | |
{ | |
"characters": "qazwsxedcrfvtgbyhnujmikolpQAZWSXEDCRFVTGBYHNUJMIKOLP", |
This file contains 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
{ | |
"Version": "2008-10-17", | |
"Id": "http referer policy example", | |
"Statement": [ | |
{ | |
"Sid": "Allow get requests from certain domains (including local development)", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::bucket-name-here/*", |
This file contains 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 | |
// define the path and name of cached file | |
$cachefile = 'cached-files/'.date('M-d-Y').'.php'; | |
// define how long we want to keep the file in seconds. I set mine to 5 hours. | |
$cachetime = 18000; | |
// Check if the cached file is still fresh. If it is, serve it up and exit. | |
if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { | |
include($cachefile); | |
exit; | |
} |
This file contains 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
<cfscript> | |
/* | |
Script: DataTables server-side script for ColdFusion (short script style) and MySQL | |
License: GPL v2 or BSD (3-point) | |
ReWrite: 12/12/2011 John Fournier | |
Notes: Adobe ColdFusion 9 + limited inline documentation used, see other long examples for explanation | |
*/ | |
datasource = 'jQueryDTable'; // set to your ColdFusion database | |
sTable = 'ajax'; // your table | |
aColumns = ['engine','browser','platform','version','grade']; // your columns |
This file contains 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 getObjectType(obj) { | |
if(obj===null)return "[object Null]"; // special case | |
return Object.prototype.toString.call(obj); | |
} |
This file contains 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 | |
$i = imagecreatefromjpeg("image.jpg"); | |
for ($x=0;$x<imagesx($i);$x++) { | |
for ($y=0;$y<imagesy($i);$y++) { | |
$rgb = imagecolorat($i,$x,$y); | |
$r = ($rgb >> 16) & 0xFF; | |
$g = ($rgb >> & 0xFF; | |
$b = $rgb & 0xFF; | |
This file contains 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
img.grayscale { | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */ | |
filter: gray; /* IE6-9 */ | |
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */ | |
} | |
img.grayscale.disabled { | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); | |
-webkit-filter: grayscale(0%); | |
} |
OlderNewer