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
$likesCategory = array( | |
"1103" => "Actor/Director", | |
"1105" => "Movie", | |
"1108" => "Producer", | |
"1109" => "Writer", | |
"1110" => "Studio", | |
"1111" => "Movie Theater", | |
"1112" => "TV/Movie Award", | |
"1113" => "Fictional Character", | |
"1200" => "Album", |
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 | |
//insert into php.ini | |
//sendmail_path = "/usr/local/bin/php /localetc/sendmail_stub/fake.php" | |
$sendMailStubObj = new SendMailStub(); | |
$sendMailStubObj->main(); | |
class SendMailStub | |
{ | |
private $_saveEmailsPath = "/home/tobur/mail/"; |
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 | |
namespace Widop\Mink\Extension; | |
/** | |
* Dictionary to manage popups. | |
* | |
* @author Benjamin Lazarecki <[email protected]> | |
*/ | |
trait PopupDictionary |
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
protected function execute($link, $parameters = array(), $method = "GET", $headers = array(), $accessToken = null) | |
{ | |
$parametersString = ''; | |
$curl = curl_init(); | |
curl_setopt($curl, CURLOPT_URL, $link); | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | |
if ($accessToken) { | |
$headers[] = 'Authorization: Bearer '.$accessToken; | |
} |
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
/** | |
* | |
* @param Request $request | |
* @param AuthenticationException $exception | |
* @return \Symfony\Component\HttpFoundation\RedirectResponse | |
*/ | |
public function onAuthenticationFailure(Request $request, AuthenticationException $exception) | |
{ | |
$data = $request->request->All('_username'); | |
$username = $data['_username']; |
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
private function onFailure(GetResponseEvent $event, Request $request, AuthenticationException $failed) | |
{ | |
if (null !== $this->logger) { | |
$this->logger->info(sprintf('Authentication request failed: %s', $failed->getMessage())); | |
} | |
$token = $this->securityContext->getToken(); | |
if ($token instanceof UsernamePasswordToken && $this->providerKey === $token->getProviderKey()) { | |
$this->securityContext->setToken(null); | |
} |
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
var geocoder = new google.maps.Geocoder(); | |
geocoder.geocode({"address":$('#'+settings.findInputId).val()}, function(results, status) { | |
if (status == google.maps.GeocoderStatus.OK) { | |
var lat = results[0].geometry.location.lat(), | |
lng = results[0].geometry.location.lng(), | |
placeName = results[0].address_components[0].long_name, | |
latlng = new google.maps.LatLng(lat, lng); | |
marker.setPosition(latlng); | |
infowindow.setContent(placeName); |
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 | |
/** | |
* | |
* @Service("core.event_listener.kernel") | |
* | |
* @Tag("kernel.event_listener", attributes = { "event" = "kernel.request", "method" = "processApi" }) | |
*/ | |
class Kernel | |
{ |
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
$ git branch -r --merged | | |
awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | | |
xargs git push origin --delete |
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 | |
/** | |
* @return DateTime | |
*/ | |
function getNextPaymentDate(DateTime $lastPaymentDate = null) | |
{ | |
// 1. Get start date | |
$day = 1; |
OlderNewer