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 | |
$secret = "supersecret"; | |
if(isset($_COOKIE['secret']) && $_COOKIE['secret'] == $secret) | |
{ | |
} | |
else | |
{ | |
if(!isset($_GET['secret'])) | |
{ |
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
/* | |
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes. | |
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed | |
* | |
* Usage: | |
* $ casperjs screenshots.js http://example.com | |
*/ | |
var casper = require("casper").create(); |
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
var system = require('system'); | |
if (system.args.length < 5) { | |
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code."); | |
phantom.exit(); | |
} | |
var account = system.args[1]; | |
var username = system.args[2]; | |
var password = system.args[3]; |
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
// requires | |
var utils = require('utils'); | |
var casper = require('casper').create() | |
var casper = require('casper').create({ | |
verbose: true, | |
logLevel: "debug" | |
}); | |
// setup globals | |
var email = casper.cli.options['email'] || 'REPLACE THIS EMAIL'; |
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 namespace Sasajib\Pavilion\Api\Video; | |
use Sasajib\Pavilion\Api\Contracts\RequestValidatorInterface; | |
use Sasajib\Pavilion\Api\Exceptions\DatabaseException; | |
use Sasajib\Pavilion\Api\Exceptions\RequestValidationException; | |
use Sasajib\Pavilion\Api\Pagination\Contracts\PaginationFactoryInterface; | |
use Sasajib\Pavilion\Api\Video\Contracts\DatabaseInterface; | |
use Sasajib\Pavilion\Api\Video\Contracts\InteractorInterface; | |
use Sasajib\Pavilion\Api\Video\Contracts\ResponderInterface; |
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
//These are integrated in BaseModel as methods ... not a full class | |
public function convertDateTimeToJs($dateTime) | |
{ | |
$date = DateTime::createFromFormat('Y-m-d H:i:s', $dateTime); | |
return $date->format('M d, Y h:i:s A'); | |
} | |
public function convertToBanglaDate($inputDate) | |
{ |
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 namespace Sasajib\Pavilion\Api\NewsHeap; | |
use Sasajib\Pavilion\Api\Contracts\RequestValidatorInterface; | |
use Sasajib\Pavilion\Api\NewsHeap\Contracts\PaginationTypeInterface; | |
class TypeFactory | |
{ | |
protected $types = [ | |
'top-news' => '\Sasajib\Pavilion\Api\NewsHeap\NewsType\Top', |
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 namespace Sasajib\Pavilion\Api\NewsHeap; | |
use Sasajib\Pavilion\Api\Exceptions\DatabaseException; | |
use Sasajib\Pavilion\Api\Exceptions\RequestValidationException; | |
use Sasajib\Pavilion\Api\NewsHeap\Contracts\NewsResponseInterface; | |
class NewsHeap | |
{ | |
/** |
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 namespace Sasajib\Pavilion\Api\NewsHeap; | |
use BaseController; | |
class Controller extends BaseController | |
{ | |
public function getNewsCollection($newsType, $limit = 6) | |
{ | |
$newsHeap = $this->getNewsHeapClass(); |
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 namespace Sasajib\Pavilion\Api\NewsHeap; | |
use Sasajib\Pavilion\Api\Contracts\RequestValidatorInterface; | |
class PaginationFactory | |
{ | |
protected $types = [ | |
'normal' => '\Sasajib\Pavilion\Api\NewsHeap\PaginationType\NormalPaginator', | |
'fromto' => '\Sasajib\Pavilion\Api\NewsHeap\PaginationType\FromToPaginator' | |
]; |
OlderNewer