Разделы
Теги | RSS © 2008 – 2022
Контакты
email:
skype:
» » Страница 2

latitude - php конструктор запросов SQL


Пример SELECT
use Latitude\QueryBuilder\SelectQuery;

$select = SelectQuery::make()
    ->from('users');

echo $select->sql();
// SELECT * FROM users

https://github.com/shadowhand/latitude

tmpfile - класс для работы с временным файлом на PHP альтернатива функции tmpfile


write('abc');

// Дописать в конец
$tmpfile->write('def', FILE_APPEND);

// Способ короче
$tmpfile->puts('def');

// Прочитать весь файл
$tmpfile->read();

// Какую-то часть
$tmpfile->read(7, 5);

// Удалить файл
$tmpfile->delete();

/* ... */

// Передать URI в объект
new SplFileInfo($tmpfile);

// Переместить в другую папку
rename($tmpfile, __DIR__ . '/picture.jpg');

// Проверить на наличие
file_exists($tmpfile);

https://github.com/denisyukphp/tmpfile

php-censor - форк PHPCI, скрипт непрерывной интеграции (CI)


php-censor - форк PHPCI, скрипт непрерывной интеграции (CI)

https://github.com/corpsee/php-censor

gulp-selectors - плагин для gulp сокращает имена классов и id


var processors = {
        'css':  ['scss', 'css'],        // run the css processor on .scss and .css files 
        'html': ['haml'],               // run the html processor on .haml files 
        'js-strings':   ['js']          // run the js-strings plugin on js files 
    },
    ignores = {
        classes: ['hidden', 'active']   // ignore these class selectors, 
        ids: '*'                        // ignore all IDs 
    };
 
gs.run(processors, ignores);

https://www.npmjs.com/package/gulp-selectors и не забываем про Обзор полезных gulp плагинов

swarm-numberformat - скрипт форматирования больших числ


numberformat.format(1e10)    // or {format: 'standard'}
 // => "10.000 billion"
 numberformat.format(1e10, {format: 'scientific'})
 // => "1.0000e10"
 numberformat.format(1e10, {format: 'engineering'})
 // => "10.000E9"
 numberformat.format(1e10, {format: 'longScale'})
 // => "10.000 milliard"

https://github.com/erosson/swarm-numberformat

pakastin/animationframes - скрипт создания анимации на js


import { frames, ease } from 'animationframes';

const translate = (x, y) => `translate(${x}%, ${y}%)`;

const el = document.createElement('h1');

const animation = frames(0, 1000)
  .start(() => {
    el.style.transform = translate(-100, 0);
  })
  .progress((t) => {
    const e = ease.quartInOut(t);
    const x = -100 * (1 - e);

    el.style.transform = translate(x, 0);
  })
  .end(() => {
    el.style.transform = '';
  });

el.textContent = 'Hello world!';

document.body.appendChild(el);

https://github.com/pakastin/animationframes
«
12345678910...327
»
Вверх