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 parseVideo(url) { | |
| // - Supported YouTube URL formats: | |
| // - http://www.youtube.com/watch?v=My2FRPA3Gf8 | |
| // - http://youtu.be/My2FRPA3Gf8 | |
| // - https://youtube.googleapis.com/v/My2FRPA3Gf8 | |
| // - Supported Vimeo URL formats: | |
| // - http://vimeo.com/25451551 | |
| // - http://player.vimeo.com/video/25451551 | |
| // - Also supports relative URLs: | |
| // - //player.vimeo.com/video/25451551 |
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
| /** | |
| * The generic function loggingIdentity takes a type parameter T, and | |
| * an argument arg which is an array of Ts, and returns an array of Ts. | |
| */ | |
| function loggingIdentity<T>(arg: T[]): T[] { | |
| console.log(arg.length); // Array has a .length, so no more error | |
| return arg; | |
| } |
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 | |
| /** | |
| * Hook into WP init and add custom rewrite rule(s) | |
| */ | |
| add_action('init', 'wuhhh_add_rewrites'), 1, 0); | |
| function wuhhh_add_rewrites() { | |
| // Add a rewrite rule according to your requirements | |
| add_rewrite_rule( |
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
| Number.prototype.map = function ( in_min , in_max , out_min , out_max ) { | |
| return ( this - in_min ) * ( out_max - out_min ) / ( in_max - in_min ) + out_min; | |
| } |
NewerOlder