Skip to content

Instantly share code, notes, and snippets.

View lavandosovich's full-sized avatar
💭
PunnIng

Ilya Lebedev lavandosovich

💭
PunnIng
  • Saint-Petersburg
View GitHub Profile
@lavandosovich
lavandosovich / run_container.sh
Created June 25, 2019 14:10
Run docker container with python ml setup
IMAGE_NAME=custom.ds.image
#IMAGE_NAME=jupyter/datascience-notebook
CONT_PORT=8888
MCH_PORT=10000
CONT_NAME= # INSERT HERE
CONT_PATH=/home/jovyan/work
MCH_PATH="$PWD"
docker build . --rm -t ${IMAGE_NAME}
@lavandosovich
lavandosovich / MC Cheat Sheet
Created February 9, 2019 12:48 — forked from samiraguiar/MC Cheat Sheet
Midnight Commander Cheat Sheet
Shortcut Description
---------------------------------------------------------------
C-o Drop to the console
Insert Select/deselect file
* Invert selection on files
+ Specify file selection options (including custom pattern)
- The same as above, but for deselecting
F5/F6 Copy/move selected files
@lavandosovich
lavandosovich / tests.md
Created June 13, 2017 21:22
Unit vs Functional Testing

Unit Test - testing an individual unit, such as a method (function) in a class, with all dependencies mocked up.

Functional Test - AKA Integration Test, testing a slice of functionality in a system. This will test many methods and may interact with dependencies like Databases or Web Services.

@lavandosovich
lavandosovich / reallife.md
Created June 13, 2017 21:10
Ungit file when it comes to far

git rm --cached FILENAME

@lavandosovich
lavandosovich / entity.md
Created May 20, 2017 00:27
Entity Creation with PhpStorm

Symfony::Entity + PhpStorm shortcuts

  1. Create Entity
    • Creat folder Entity in src/AppBundle

    • Creat PHP class with the name of the table

      For Example User.php

    • add use Doctrine\ORM\Mapping as ORM; to User.php

    • with pss=PhpStorm shortcut(Ubuntu) ai = Alt+Insert choose ORM Class

  • make private fields of a Entity
@lavandosovich
lavandosovich / api.suite.yml
Last active May 26, 2017 21:58
SETUP FOR SYMFONY API CODECEPTION TESTING
//php vendor/codeception/codeception/codecept g:suite api
//Next steps:
//1. Edit api.suite.yml to enable modules for this suite
//2. Create first test with 'codecept generate:cept api TestName' ( or test|cept) command
//3. Run tests of this suite with codecept run api command
class_name: ApiTester
modules:
enabled:
- REST:
url: http://localhost:8000
@lavandosovich
lavandosovich / nameless.md
Created May 16, 2017 23:21
Usefullness at its finest

sudo vim /etc/hosts - list adresses

@lavandosovich
lavandosovich / codeception.md
Last active May 26, 2017 23:45
Codeception

Working codecept command

  • sudo composer global require codeception/codeception
  • sudo ln -s ~/.composer/vendor/bin/codecept /usr/local/bin/codecept

Codeception Installation

  • sudo apt-get install php7.1-curl php7.1-mbstring if in demand
  • composer require "codeception/codeception"
  • alias codecept='./vendor/bin/codecept' or
@lavandosovich
lavandosovich / code_style.md
Last active May 15, 2017 01:46
PSR essense jl.elama

1

Based on: PSR-1 && PSR-2

  • <?php & <&= only
  • UTF-8 only
  • Files SHOULD either declare symbols (classes, functions, constants, etc.) or cause side-effects (e.g. generate output, change .ini settings, etc.) but SHOULD NOT do both:
    • bad:

php

@lavandosovich
lavandosovich / Symfony.md
Last active May 12, 2017 00:55
Symfony tricks&tips to the rescue

Bundles && Containers && Services

1. php ./bin/console config:dump-reference

List all bundles within app

2. php ./bin/console config:dump-reference bundle_name

List settings of bundle_name bundle for config.yml file

3. php ./bin/console debug:container container_name

  • containers are setted in config.yml under bundle_name
  • options of the container are stated their, all possible options for the container are in 2
  • This command build a new service with defined attributes in config.yml