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
class MAP_API_DemoItemType extends WP_JSON_CustomPostType { | |
protected $base = '/map/demo'; | |
protected $type = 'demo'; | |
public function register_routes( $routes ) { | |
$routes = parent::register_routes( $routes ); | |
return $routes; | |
} | |
} |
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 map_prepare_post_add_score( $_post, $post, $context ) { | |
$_post['score'] = map_get_post_score( $post['ID'] ); | |
return $_post; | |
} | |
add_filter( 'json_prepare_post', 'map_prepare_post_add_score', 10, 3 ); |
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
jQuery.fn.findC = function( selector, reset ) { | |
var cache = this.data('jcache') || {}; | |
if ( reset || undefined === cache[ selector ] ) { | |
cache[ selector ] = this.find( selector ); | |
} | |
this.data( 'jcache', cache ); | |
return cache[ selector ]; | |
}; |
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
{ | |
"path_mapping": { | |
"/srv/www": "/full-path-to-your-vvv-installation/www" | |
} | |
} |
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
#!/usr/bin/php | |
<?php | |
echo PHP_EOL; | |
echo 'Starting unit tests' . PHP_EOL; | |
exec( 'phpunit', $test_output, $returnCode ); | |
if ( 0 !== $returnCode ) { | |
echo implode( PHP_EOL, $test_output ); | |
echo PHP_EOL; |
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class Parallax : MonoBehaviour { | |
// Scale of movement 0 being stationary 1 being sticking to the camera. | |
public Vector2 parallaxScale = new Vector2( 0.5f, 0.2f ); |