slatejs - скприт для создания визивиг редактора
https://github.com/ianstormtaylor/slate
use Da\Mailer\Model\MailMessage;
use Da\Mailer\Queue\MailQueue;
use Da\Mailer\Queue\Backend\Beanstalkd\BeanstalkdMailJob;
use Da\Mailer\Queue\Backend\Beanstalkd\BeanstalkdQueueStoreAdapter;
use Da\Mailer\Queue\Backend\Beanstalkd\BeanstalkdQueueStoreConnection;
use PDO;
$message = new MailMessage([
'from' => '[email protected]',
'to' => '[email protected]',
'subject' => 'What is up?',
]);
$conn = new BeanstalkdQueueStoreConnection([
'host' => 'localhost',
'port' => 'root']);
$adapter = new BeanstalkdQueueStoreAdapter($conn);
$queue = new MailQueue($adapter);
$job = new BeanstalkdMailJob([
'message' => json_encode($message),
]);
if (!$queue->enqueue($job)) {
// ... queue operation failed
}
use Da\Mailer\Queue\MailQueue;
use Da\Mailer\Queue\Backend\Beanstalkd\BeanstalkdQueueStoreAdapter;
use Da\Mailer\Queue\Backend\Beanstalkd\BeanstalkdQueueStoreConnection;
$conn = new BeanstalkdQueueStoreConnection([
'connectionString' => 'mysql:host=localhost;dbname=test',
'username' => 'root',
'password' => 'password'
], [PDO::ATTR_PERSISTENT => true]);
$adapter = new BeanstalkdQueueStoreAdapter($conn);
$queue = new MailQueue($adapter);
if (($job = $queue->dequeue()) !== null) {
// ... do something with received job
// ... send it using `mail()` function for example
// ... or by using MailMessageWorker
$job->markAsCompleted();
$queue->ack($job);
}
use Spatie\Regex\Regex;
// Using `match`
Regex::match('/a/', 'abc'); // `MatchResult` object
Regex::match('/a/', 'abc')->hasMatch(); // true
Regex::match('/a/', 'abc')->result(); // 'a'
// Capturing groups with `match`
Regex::match('/a(b)/', 'abc')->result(); // 'ab'
Regex::match('/a(b)/', 'abc')->group(1); // 'a'
// Using `matchAll`
Regex::matchAll('/a/', 'abcabc')->hasMatch(); // true
Regex::matchAll('/a/', 'abcabc')->results(); // Array of `MatchResult` objects
// Using replace
Regex::replace('/a/', 'b', 'abc')->result(); // 'bbc';
Regex::replace('/a/', function (MatchResult $result) {
return $result->result() . 'Hello!';
}, 'abc')->result(); // 'aHello!bc';
inView('.someSelector')
.on('enter', doSomething)
.on('exit', el => {
el.style.opacity = 0.5;
});
register();
$gen = new GenPhrase\Password();
// Generate a passphrase using english words and (at least) 50 bits of entropy.
$gen->generate();