email: [email protected]
skype: utz0r2
github: utz0r2
Разделы: CSS, HTML, PHP, JS, Видео, Заметки
vvStore | vvShop
© 2008 – 2019
» »

mpratt/Embera - php скрипт проверяет ссылки и если это embed ссылка, то конвертирует ее

Поддерживает 60+ сайтов
Пример использования
$config = array(
        'params' => array(
            'width' => 300,
            'height' => 500
        )
    );

    $text = 'Check this video out http://vimeo.com/groups/shortfilms/videos/66185763';

    $embera = new \Embera\Embera($config);
    echo $embera->autoEmbed($text);

    /*Check this video out <iframe src="http://player.vimeo.com/video/66185763" width="300" height="480" ....*/

https://github.com/mpratt/Embera

pipe-dream/laravel - скрипт для быстрого развертывания приложения на laravel


https://github.com/pipe-dream/laravel

terrylinooo/shieldon - защита от кучи запросов к сайту

terrylinooo/shieldon - защита от кучи запросов к сайту

Когда пользователи или роботы пытаются просмотреть множество ваших веб-страниц за короткий промежуток времени, их временно банят. Получить разбан можно, пройдя капчу.
$shieldon = new \Shieldon\Shieldon();

// Use SQLite as the data driver.
$dbLocation = APPPATH . 'cache/shieldon.sqlite3';
$pdoInstance = new \PDO('sqlite:' . $dbLocation);
$shieldon->setDriver(new \Shieldon\Driver\SqliteDriver($pdoInstance));

// Set components.
// This component will only allow popular search engine.
// Other bots will go into the checking process.
$shieldon->setComponent(new \Shieldon\Component\TrustedBot());

// You can ignore this setting if you only use one Shieldon on your web application. This is for multiple instances.
$shieldon->setChannel('web_project');

// Only allow 10 sessions to view current page.
// The default expire time is 300 seconds.
$shieldon->limitSession(10);

// Set a Captcha servie. For example: Google recaptcha.
$shieldon->setCaptcha(new \Shieldon\Captcha\Recaptcha([
    'key' => '6LfkOaUUAAAAAH-AlTz3hRQ25SK8kZKb2hDRSwz9',
    'secret' => '6LfkOaUUAAAAAJddZ6k-1j4hZC1rOqYZ9gLm0WQh',
]));

// Start protecting your website!

$result = $shieldon->run();


if ($result !== $shieldon::RESPONSE_ALLOW) {
    if ($shieldon->captchaResponse()) {

        // Unban current session.
        $shieldon->unban();
    }
    // Output the result page with HTTP status code 200.
    $shieldon->output(200);
}

https://github.com/terrylinooo/shieldon

remotelyliving/php-dns - DNS абстракция в PHP

$resolver = new Resolvers\GoogleDNS();
$hostname = 'google.com';

// can query via convenience methods
$records = $resolver->getARecords($hostname); // returns a collection of DNS A Records

// can also query by any RecordType. Record Types are a proper object that validate you have the right type.
$recordType = DNSRecordType::createAAAA();

// OR

$recordType = DNSRecordType::TYPE_AAAA;

$moreRecords = $resolver->getRecords($hostname, $recordType);

// can query to see if any resolvers find a record or type.
$resolver->hasRecordType($hostname, $type) // true | false
$resolver->hasRecord($record) // true | false

// This becomes very powerful when used with the Chain Resolver

https://github.com/remotelyliving/php-dns

azdanov/php-interview-exercises - репозиторий с заданиями на интервью по PHP

<?php
declare(strict_types=1);
namespace Exercises\FizzBuzz;
/**
 * Print numbers from 1 to n.
 * When n is divisible by 3 echo 'fizz'.
 * When n is divisible by 5 echo 'buzz.
 * When n is divisible by both 3 and 5 echo 'fizzbuzz'.
 *
 * @method static void print(int $limit)
 * @example FizzBuzz::print('5') -> 1, 2, 'fizz', 4, 'buzz'
 */
final class FizzBuzz
{
}

<?php
declare(strict_types=1);
namespace Exercises\FizzBuzz\Complete;
final class FizzBuzzComplete
{
    public static function print(int $limit): void
    {
        for ($i = 1; $i <= $limit; ++$i) {
            $word = '';
            if ($i % 3 === 0) {
                $word .= 'fizz';
            }
            if ($i % 5 === 0) {
                $word .= 'buzz';
            }
            echo $word ?: $i;
        }
    }
}

https://github.com/azdanov/php-interview-exercises

bernardphp/bernard - PHP-библиотека для создания фоновых заданий для последующей обработки

Поддерживает
- Predis / PhpRedis
-Amazon SQS
- Iron MQ
- Doctrine DBAL
- Pheanstalk
- PhpAmqp / RabbitMQ
- Queue interop
<?php

use Bernard\Driver\Predis\Driver;
use Predis\Client;

$predis = new Client('tcp://localhost', array(
    'prefix' => 'bernard:',
));

$driver = new Driver($predis);
Запуск
$ php ./example/predis.php consume
$ php ./example/predis.php produce

https://github.com/bernardphp/bernard
«»
Вверх