Content from http://www.phantompilots.com/threads/phantom-3-standard-range-mod-lets-do-it-together.80721/page-15#post-840050
To avoid more and more user brick the RC/Drone, I discover a new solution to do this mod:
/* Get the ID from a youtube link */ | |
function getYoutubeID(url) { | |
var id = url.match("[\\?&]v=([^&#]*)"); | |
id = id[1]; | |
return id; | |
}; | |
/* Get an image preview of the video */ | |
var thumb_url = "http://i3.ytimg.com/vi/"+getYoutubeID('MY-YOUTUBE-VIDEO-URL')+"/maxresdefault.jpg"; | |
$('<img id="video-preview" src="'+thumb_url+'" />').prependTo($("div.preview-video")); |
<!-- This simple piece of code will look for specific links, verify them using HEAD request to know if it exists/is accessible or not --> | |
<!-- Every failed files will be displayed into the failed-list <span> --> | |
<!-- NOTE : This script might "freeze" your browser for a while, don't worry, let it finish --> | |
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script> | |
<button id="launch-link-test">Test all links</button> | |
<li><a target="_blank" data-count="0" href="link-to-file.pdf">Link 0</a><span id="url-valid-0"></span></li> | |
<li><a target="_blank" data-count="1" href="link-to-file1.pdf">Link 1</a><span id="url-valid-1"></span></li> | |
<li><a target="_blank" data-count="2" href="link-to-file2.pdf">Link 2</a><span id="url-valid-2"></span></li> | |
<li><a target="_blank" data-count="3" href="link-to-file3.pdf">Link 3</a><span id="url-valid-3"></span></li> |
<?php | |
$re = "/^(([^:\\/?#]+):)?(\\/\\/([^\\/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/"; | |
$str = "http://www.ics.uci.edu/pub/ietf/uri/?page=3&color=red#Related\n"; | |
preg_match($re, $str, $matches); | |
/* matches will be | |
1. [0-5] `http:` | |
2. [0-4] `http` |
var robots = new Array(); | |
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.start = function( ev ){ |
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.clone(); |
# Things needed to be adapted : | |
# server_name my-domain.com | |
# | |
# root /home/www | |
# The root of the Symfony "web" folder (with app.php and app_dev.php in it). | |
# | |
# fastcgi_pass unix:/var/run/php5-fpm.sock | |
# This sock can be elsewhere (/var/run/php5-fpm/php5-fpm.sock for example...) | |
# | |
# There are other things needed to be changed/fixed. |
Content from http://www.phantompilots.com/threads/phantom-3-standard-range-mod-lets-do-it-together.80721/page-15#post-840050
To avoid more and more user brick the RC/Drone, I discover a new solution to do this mod:
I hereby claim:
To claim this, I am signing this object:
//Add this code to the end of the functions.php file of your wordpress theme | |
// This forces images urls and links of your website to be displayed with https | |
function force_https_the_content($content) { | |
if ( is_ssl() ) | |
{ | |
$content = str_replace( 'src="http://my-domain.tld', 'src="https://my-domain.tld', $content ); | |
$content = str_replace( 'href="http://my-domain.tld', 'href="https://my-domain.tld', $content ); | |
} | |
return $content; | |
} |
<?php | |
namespace Acme\Security\Roles; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Routing\RouterInterface; | |
use Symfony\Component\Routing\Route; | |
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface; | |
use Symfony\Component\Security\Core\User\UserProviderInterface; | |
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; | |
use Symfony\Bridge\Monolog\Logger; |