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
| <cfscript> | |
| function convertQueryToStructArray( q ) { | |
| var result = []; | |
| for ( var row in arguments.q ) { | |
| result.append( row ); | |
| } | |
| return result; | |
| } |
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
| <cfscript> | |
| function data_uri(fullFilePath, mimeType='image/*') { | |
| var contents = fileReadBinary(fullFilePath); | |
| var base64contents = toBase64(contents); | |
| var returnString = "data:" & mimeType & ";base64," & base64contents; | |
| return returnString; | |
| } | |
| </cfscript> |
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 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 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
| component { | |
| boolean function onRequestStart( required string targetPage ) { | |
| var headers = getHttpRequestData().headers; | |
| var origin = ''; | |
| var PC = getpagecontext().getresponse(); | |
| // Find the Origin of the request | |
| if( structKeyExists( headers, 'Origin' ) ) { |
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
| #!/bin/bash | |
| # Backup all important files on my computer using Duplicity | |
| # Folders to include | |
| include_directories=(/home/me /etc) | |
| # Folders to exclude | |
| exclude_directories=() |
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
| #!/bin/bash | |
| #The MIT License (MIT) | |
| # | |
| #Copyright (c) 2014 Moritz Heiber <[email protected]> | |
| # | |
| #Permission is hereby granted, free of charge, to any person obtaining a copy | |
| #of this software and associated documentation files (the "Software"), to deal | |
| #in the Software without restriction, including without limitation the rights | |
| #to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| #copies of the Software, and to permit persons to whom the Software is |
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
| #!/bin/sh | |
| # | |
| # Backuping | |
| # --------- | |
| # dups3 backup | |
| # | |
| # Restoring | |
| # --------- | |
| # dups3 restore /home/my/foo.txt ~/restore # Restore a file | |
| # dups3 restore /home/my ~/restore # Restore a directory |
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
| <CFSETTING ENABLECFOUTPUTONLY="YES"> | |
| <!--- | |
| NAME: CF_GraphicsMagick | |
| DESCRIPTION: ColdFusion wrapper for some GraphicsMagick routines. Faster than CFImage. Generates smaller images. Better | |
| CMYK compatilibity (Adds compatibility to CF9.) | |
| Works with more images formats, including EPS: http://www.graphicsmagick.org/formats.html | |
| EXAMPLES: | |
| <CF_GraphicsMagick action="AspectScale" Infile="#ImageIn#" Outfile="#imageOut#" width="#W#" height="#H#"> |
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
| <cffunction | |
| name="csvToArray" | |
| access="public" | |
| returntype="array" | |
| output="false" | |
| hint="I take a CSV file or CSV data value and convert it to an array of arrays based on the given field delimiter. Line delimiter is assumed to be new line / carriage return related."> | |
| <!--- Define arguments. ---> | |
| <cfargument | |
| name="file" |