Skip to content

Instantly share code, notes, and snippets.

aktuba aktuba

Block or report user

Report or block aktuba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View query.php
<?php
protected static function getDefaultQuery(?User $user = null, string $prefix = 'n'): Builder {
$table = \Cache::get('arr')->callback(__METHOD__, function() use($prefix) {
return (new static)->getTable()." as {$prefix}";
});
$result = static::query()->from($table);
if (null !== $user && $user->exists) {
$user->addIgnoresToQuery($result, ['user', 'doc', 'category'], $prefix);
View query.php
<?php
protected static function getDefaultQuery(?User $user = null, string $prefix = 'n'): Builder {
$table = \Cache::get('arr')->callback(__METHOD__, function() use($prefix) {
return (new static)->getTable()." as {$prefix}";
});
$result = static::query()->from($table);
if (null !== $user && $user->exists) {
$user
View db.sql
select
n.*,
nt.`before_cut`,
nt.`cut_text`,
d.`domain` as `doc_domain`,
d.`openness` as `doc_openness`,
d.`name` as `doc_name`,
c.`id` as `category_id`,
c.`domain` as `category_domain`,
c.`name` as `category_name`,
View gist:7e023843f1be639673802667548a531c
<?php declare(strict_types=1);
namespace Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* Class Parking
* @package Model
*
View youtube.com
php test.php
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Server Name: YOUTUBE.COM.BLACKRAMINC.COM
IP Address: 208.65.153.238
@aktuba
aktuba / placeholdit.php
Created Mar 30, 2017 — forked from uhtred/placeholdit.php
PHP: Placehold it image
View placeholdit.php
<?php
/*
How to use
/940x278
/940x278/000000
/940x278&text=Texto
/940x278/000000&text=Texto
RewriteEngine On
View upload
function image_upload($ps) {
if ($ps != PS) Request::redirect();
Loader::helper('image');
$servers = Loader::config('servers', TRUE);
$send_to = 'nfs';
if (isset($servers['load_to']) && $servers['load_to'] == 'ftp') {
$send_to = 'ftp';
}
View phalcon micro
<?php
use Phalcon\Mvc\Micro;
$time = microtime(true);
$mem = memory_get_peak_usage(true);
$app = new Micro();
$app->get(
"/",
@aktuba
aktuba / nginx.conf
Created Oct 8, 2015 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
View sql.sql
SELECT
*,
weight() AS `weight`
FROM
`address`
WHERE
MATCH('
@address("Парковая 11-я ул., д. 32"/1)
MAYBE @locality_name("москва")
MAYBE @street_name("парковая улица" ~2 | "15-я парковая улица" ~2 | "9-я парковая улица" ~2 | "13-я парковая улица" ~2 | "5-я парковая улица" ~2 | "12-я парковая улица" ~2 | "3-я парковая улица" ~2 | "4-я парковая улица" ~2 | "16-я парковая улица" ~2 | "11-я парковая улица" ~2 | "7-я парковая улица" ~2 | "1-я парковая улица" ~2 | "6-я парковая улица" ~2 | "2-я парковая улица" ~2 | "8-я парковая улица" ~2 | "14-я парковая улица" ~2 | "10-я парковая улица" ~2 | "парковая" | "сосново-парковая улица" ~2 | "парковая площадка" ~2)
You can’t perform that action at this time.