Разделы
Теги | RSS © 2008 – 2017
Контакты
email: igor@veselov.sumy.ua
skype: utz0r2
» » » Страница 6

vamsiikrishna/vex - маленький пхп скрипт для создания нагрузочного тестирования


vamsiikrishna/vex - маленький пхп скрипт для создания нагрузочного тестирования

Пример
1000 Get запросов в 10 потоков http://127.0.0.1:8000
./vex.phar vex http://127.0.0.1:8000 1000 10

https://github.com/vamsiikrishna/vex

nanoid - маленький простой скрипт для генерации уникального id на js


var generate = require('nanoid/generate')
model.id = generate('1234567890abcdef', 10) //=> "4f90d13a42"

https://github.com/ai/nanoid

easydb - простая обертка для PDO


PDO
$db = new \PDO(
    'mysql:host=localhost;dbname=something',
    'username',
    'putastrongpasswordhere'
);

$statement = $db->prepare('SELECT * FROM comments WHERE blogpostid = ? ORDER BY created ASC');
$exec = $statement->execute([$_GET['blogpostid']]);
$rows = $exec->fetchAll(\PDO::FETCH_ASSOC);
foreach ($rows as $row) {
    $template_engine->render('comment', $row);
}

EasyDB
$db = \ParagonIE\EasyDB\Factory::create(
    'mysql:host=localhost;dbname=something',
    'username',
    'putastrongpasswordhere'
);

$rows = $db->run('SELECT * FROM comments WHERE blogpostid = ? ORDER BY created ASC', $_GET['blogpostid']);
foreach ($rows as $row) {
    $template_engine->render('comment', $row);
}

https://github.com/paragonie/easydb

jakzal/phpqa - инструменты статического анализа PHP в докер контейнере


composer - Dependency Manager for PHP
box - An application for building and managing Phars
php-cs-fixer - PHP Coding Standards Fixer
phpcf - Finds usage of deprecated features
phpca - Finds usage of non-built-in extensions
phpdoc-to-typehint - Automatically adds type hints and return types based on PHPDocs
php-formatter - Custom coding standards fixer
phpmetrics - Static Analysis Tool
phpstan - Static Analysis Tool
phan - Static Analysis Tool
dephpend - Detect flaws in your architecture
psalm - Finds errors in PHP applications
phpDocumentor - Documentation generator
phpcpd - Copy/Paste Detector
phploc - A tool for quickly measuring the size of a PHP project
phpmd - A tool for finding problems in PHP code
phpmnd - Helps to detect magic numbers
pdepend - Static Analysis Tool
phpcs - Detects coding standard violations
phpcbf - Automatically corrects coding standard violations
phpcb - PHP Code Browser
phpa - Checks for weak assumptions
deprecation-detector - Finds usages of deprecated code
deptrac - Enforces dependency rules
phpda - Generates dependency graphs
php-coupling-detector - Detects code coupling issues
analyze - Visualizes metrics and source code
design-pattern - Dettects design patterns
parallel-lint - Checks PHP file syntax
php-semver-checker - Suggests a next version according to semantic versioning
https://github.com/jakzal/phpqa

rikschennink/fitty - js скрипт вписывает текст в блок по размеру


rikschennink/fitty - js скрипт вписывает текст в блок по размеру

https://github.com/rikschennink/fitty

xkeshi/image-compressor - js компрессор изображений


<input type="file" id="file" accept="image/*">
import axios from 'axios';
import ImageCompressor from 'image-compressor';

document.getElementById('file').addEventListener('change', (e) => {
  const file = e.target.files[0];

  if (!file) {
    return;
  }

  new ImageCompressor(file, {
    quality: .6,
    success(result) {
      const formData = new FormData();

      formData.append('file', result);

      // Send the compressed image file to server with XMLHttpRequest.
      axios.post('/path/to/upload', formData).then(() => {
        console.log('Upload success!');
      });
    },
    error(e) {
      console.log(e.message);
    },
  });
})

Работает на последних версиях браузеров
https://github.com/xkeshi/image-compressor
«»
Вверх