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
# 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 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 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 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 | |
/** | |
* Deterministically generates an unpredictable number from the input within a given range | |
* Intended for int|float but will accept anything | |
* | |
* Uses MD5 to generate a number between 0–268435455 then "scales" that number into the desired range | |
* | |
* @param mixed $input Variable to use as seed | |
* @param int|float $min Lower range for desired output |
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 | |
function url() { | |
$url = @( $_SERVER['HTTPS'] != 'on' ) ? 'http://' : 'https://'; // Protocol | |
$url .= $_SERVER['SERVER_NAME']; // Host | |
if ($_SERVER['SERVER_PORT'] != 80) $url .= ':'.$_SERVER['SERVER_PORT']; // Port | |
if ($_SERVER['REQUEST_URI'] !== '/') $url .= $_SERVER['REQUEST_URI']; // Request | |
return $url; | |
} |
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
.well-inverse { | |
box-shadow: | |
0 1px 1px rgba(0, 0, 0, .05), | |
0 1px 1px white inset; | |
} |
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
[aria-expanded="false"] .collapse-opened, | |
[aria-expanded="true"] .collapse-closed { | |
display: none; | |
} |
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
.sans { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } | |
.serif { font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } | |
.monospace { font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; } |
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 | |
/** | |
* Moves all pages of a CPT (Custom Post Type) into one menu item | |
* Useful when a CPT is a submenu & the Add New page goes walkies | |
* | |
* Example: You have added a new CPT under an existing CPT or | |
* menu item. When you click "Add New" for the new CPT, the URL | |
* doesn't match a menu item so nothing is selected as the | |
* current page. This function makes such pages show as the main |