This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //... | |
| public function productsTable() { | |
| $query = \DB::table('products')->leftJoin('brands', 'brands.id', '=', 'products.brand_id') | |
| ->select([\DB::raw("CONCAT(products.name, ' ', products.code) as full_name"),'products.slug','price','brands.name as brand','products.id']); | |
| return datatables($query) | |
| ->addColumn('action', function ($row) { | |
| return '<a href="'.$row->id.'" class="btn btn-sm btn-primary">Edit'.$row->id.'</a>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if (! function_exists('dqd')) { | |
| /** | |
| * Dump info about query in builder and end the script. | |
| * | |
| * @param $query | |
| * @param bool $short | |
| */ | |
| function dqd($query, $short = false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Pion\Traits\Models; | |
| use Illuminate\Database\Query\Expression; | |
| use Illuminate\Support\Str; | |
| /** | |
| * Class ModelJoinTrait | |
| * | |
| * Trait to create model join for scope with detection of model in the attributes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM php:5.6.40-apache | |
| RUN a2enmod rewrite | |
| RUN set -xe \ | |
| && apt-get update \ | |
| && apt-get install -y libxml2-dev libpng-dev libjpeg-dev libc-client-dev libkrb5-dev curl \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \ | |
| && docker-php-ext-configure imap --with-imap-ssl --with-kerberos \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express'); | |
| var app = express(); | |
| var mysql = require('mysql'); | |
| //var nodeadmin = require(__dirname + '/../middleware/index.js'); | |
| var nodeadmin = require('nodeadmin'); //https://github.com/nodeadmin/nodeadmin | |
| //app.use(nodeadmin(app)); | |
| app.use(nodeadmin(app, process.env.PORT || 4040)); | |
| app.use('/', function(req, res, next) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # $http_x_firebase | |
| log_format postdata escape=json '$remote_addr $remote_user [$time_local] $request_time $request $status $body_bytes_sent $http_referer "$http_user_agent"' | |
| ' $request_body'; | |
| server { | |
| listen 443 ssl http2; | |
| server_name site.com; | |
| access_log "/var/log/nginx/site.com_ssl-access.log" postdata; | |
| error_log "/var/log/nginx/site.com_ssl-error.log" warn; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Title</title> | |
| </head> | |
| <body> | |
| <style type="text/css"> | |
| TABLE { | |
| width: 300px; /* Ширина таблицы */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| header('Accept : application/json'); | |
| header('Access-Control-Allow-Origin : *'); | |
| header('Access-Control-Allow-Methods : POST,GET,OPTIONS,PUT,DELETE'); | |
| header('X-Requested-With : XMLHttpRequest'); | |
| header('Access-Control-Allow-Headers : Content-Type,Authorization'); | |
| //https://cors-anywhere.herokuapp.com/ | |
| if (!empty($_SERVER["REQUEST_METHOD"]) && $_SERVER['REQUEST_METHOD']=='OPTIONS') { | |
| header("HTTP/1.1 204 NO CONTENT"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $menu = \App\Menu::find(1); | |
| $menu->getDescendantsAndSelf(); | |
| $menu = \App\Menu::find(3); | |
| $menu->getAncestorsAndSelf(); | |
| $menu = \App\Menu::find(1); | |
| dd($menu->getTree()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "github.com/gohouse/gorose/v2" | |
| _ "github.com/go-sql-driver/mysql" | |
| ) | |
| var err error |