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
Admin: | |
MYSQL -UUSERNAME -PPASSWORD -HHOST DB_NAME < FILE_NAME.SQL — залить бд; | |
MYSQLDUMP -UUSERNAME -PPASSWORD -HHOST DB_NAME > FILE_NAME.SQL — сделать дамп бд; | |
---------------------------------------------------------------------------------------------------------------------- | |
create database <name_db>; | |
show databases; | |
show tables from <name_db>; | |
show columns from <db_name.table_name>; #вывести список колонок в таблице со свойствами | |
exit — выход из консольки MySQL. | |
------------------------------------------------------------------------------------------------------------------------ |
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
@inject('obj', 'App\КлассМодели::СататическийМетод') |
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
Schema::create('pages', function (Blueprint $table) { | |
$table->increments('id'); | |
$table->string('name_page'); | |
$table->string('meta_k'); | |
$table->string('meta_d'); | |
$table->text('content'); | |
$table->integer('category_id')->unsigned(); | |
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade'); | |
$table->timestamps(); | |
}); |
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
$factory->define(App\Post::class, function (Faker\Generator $faker) { | |
return [ | |
'title' => $faker->title, | |
'body' => $faker->paragraph(10), | |
'user_id'=>function () { | |
return factory(App\User::class)->create()->id; | |
} | |
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
#include<stdio.h> //библиотека ввода/вывода | |
//#include<stdlib.h> // библиотека для функции getchar() для линукца | |
#include<conio.h> | |
// | |
int main(){ | |
int n,a,b,result; | |
char opt; | |
do { | |
printf("колавиша 1: сложение\n"); |
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
interface BarInterface { | |
} | |
class Bar implements BarInterface | |
{ | |
} | |
App::bind('BarInterface','bar'); |
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
/* фабрика */ | |
class Auto { | |
private $_make; | |
private $_model; | |
public function __construct($make, $model){ | |
$this->_make = $make; | |
$this->_model = $model; | |
} | |
public function getMakeModel(){ |
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 canvas = document.getElementById('canvas'); | |
var width = canvas.width; | |
var height = canvas.height; | |
var renderer = new THREE.WebGLRenderer({canvas:canvas}); | |
renderer.setClearColor(0xFFFFFF); | |
//создание сцены: |
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 console\controllers; | |
use yii\console\Controller; | |
use yii\helpers\Console; | |
class ArrayController extends Controller { | |
public function actionIndex(){ | |
$result = array(12,36,45,55,44,122,5,2,7); |
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 console\controllers; | |
use yii\console\Controller; | |
use yii\helpers\Console; | |
class ProgressController extends Controller { | |
public function actionIndex(){ | |
$result = $this->prompt("запуск прогресс бара: "); |