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 | |
| /** | |
| * Normalizes a number to within a desired range | |
| * | |
| * @param int|float $input Number to be normalized | |
| * @param int|float $inputMin Lowest number that $input can possibly be | |
| * @param int|float $inputMax Highest number that $input can possibly be | |
| * @param int|float $outputMin Lower range for desired output | |
| * @param int|float $outputMax Upper range for desired output |
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
| .ng-enter { opacity: 0; transition: .3s opacity ease; height: 0; } | |
| .ng-enter-active { opacity: 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
| # Batch rename files (underscores to hyphens) | |
| Dir | Rename-Item –NewName { $_.name –replace "_","-" } | |
| # Get full path of all files | |
| gci -r | where {$_.extension -match ".html|.htm|.php|.asp"} | select FullName | |
| # Delete all files except... | |
| gci -r | ? {$_.extension -notmatch ".html|.htm|.php|.asp"} | ? {-not $_.PsIsContainer } | remove-item | |
| # Delete SVN folders |
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
| .ace_line { | |
| white-space: normal !important; | |
| text-indent: -1em; | |
| padding-left: 1em; | |
| } |
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
| .responsive-iframe { | |
| position: relative; | |
| padding-bottom: 56.25%; /* 16:9 */ | |
| height: 0; | |
| } | |
| .responsive-iframe iframe { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; |
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 uuid() { | |
| var uuid = "", i, random; | |
| for (i = 0; i < 32; i++) { | |
| random = Math.random() * 16 | 0; | |
| if (i == 8 || i == 12 || i == 16 || i == 20) { | |
| uuid += "-" | |
| } | |
| uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16); | |
| } | |
| return uuid; |
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
| # Backup system to /backup.tgz | |
| sudo su | |
| cd / | |
| tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys --exclude=/media / |
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 //Adds the format red to CKEditor with defined styles | |
| define('GSEDITOROPTIONS', " | |
| format_tags: 'p;h2;h3;h4;h5;h6;pre;small;red', | |
| format_small: { | |
| name: 'Small', | |
| element: 'small' | |
| }, | |
| format_red: { | |
| name: 'Red', |
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 toggleFullScreen() { | |
| var doc = window.document; | |
| var docEl = doc.documentElement; | |
| var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen; | |
| var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen; | |
| if(!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement) { | |
| requestFullScreen.call(docEl); | |
| } | |
| else { | |
| cancelFullScreen.call(doc); |
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
| USE database | |
| SELECT * FROM INFORMATION_SCHEMA.TABLES | |
| WHERE TABLE_NAME LIKE '%attachment%' | |
| AND TABLE_TYPE = 'BASE TABLE' |