latitude - php конструктор запросов SQL
Пример SELECT
use Latitude\QueryBuilder\SelectQuery;
$select = SelectQuery::make()
->from('users');
echo $select->sql();
// SELECT * FROM users
https://github.com/shadowhand/latitude
use Latitude\QueryBuilder\SelectQuery;
$select = SelectQuery::make()
->from('users');
echo $select->sql();
// SELECT * FROM users
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);
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);
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"
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);