Skip to content

Instantly share code, notes, and snippets.

View kix's full-sized avatar

Stepan Anchugov kix

  • Belgrade
  • 05:34 (UTC +02:00)
View GitHub Profile
@florentdestremau
florentdestremau / NewPasswordType.php
Last active January 5, 2025 11:57
A simple User authentication setup to copy & paste into your Symfony 3.4 install
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
@joshdover
joshdover / README.md
Last active September 28, 2023 21:38
Idiomatic React Testing Patterns

Idiomatic React Testing Patterns

Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.

Setup

I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a beforeEach. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern that gives great defaults for each test example but allows every example to override props when needed:

Ок. У нас сегодня последняя большая тема, в выходные будет формат полегче. Перед тем как к ней переходить несколько тезисов из прошлых дней:

  1. Я считаю что модель верстки компонентами для любого крупного проекта подходит лучше, чем любай другая.
  2. Компонент включает HTML, CSS, JS, тесты, локализации, мануал и т. д. Эти файлы проще всего хранить и использовать вместе.
  3. Браузер это ассемблер которому мы кормим оптимизированный машинный код в разных форматах.
  4. CSS, JS и HTML должны знать структуру друг друга, это позволяет гораздо эффективнее их сокращать, пожимать и оптимизировать.

Использование в последние годы штук вроде Webpack, React и CSS Modules меня лично убедило что при таком подходе к коду жить проще и приятнее.

Это все хорошо пока ты делаешь SPA, но есть проекты которым противопаказано быть SPA, а пользы от компонентов и оптимизаций было бы много.

@imjasonh
imjasonh / markdown.css
Last active September 3, 2025 22:12
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@generalov
generalov / gitconfig
Created September 5, 2014 13:16
gitconfig
[user]
name = Evgeny V. Generalov
email = e.generalov@gmail.com
[alias]
st = status
ci = commit
co = checkout
wc = diff --staged
br = branch
@h4cc
h4cc / Makefile
Last active July 4, 2017 23:35
Ubuntu 14.04 LTS Trusty Tahr - Basic packages i usually install
#
# Ubuntu 14.04 LTS (Trusty Tahr)
#
# Basic packages i usually install
#
# Author: Julius Beckmann <github@h4cc.de>
#
# For 16.04 Xenial Xerus: https://gist.github.com/h4cc/fe48ed9d85bfff3008704919062f5c9b
#
@johnkary
johnkary / satis.json
Last active December 21, 2015 11:59
satis.json config file for setting up a local mirror of common Symfony2 dependencies
{
"name": "My Project",
"homepage": "http://satis",
"output-dir": "web",
"repositories": [
{ "type": "vcs", "url": "https://github.com/symfony/symfony" },
{ "type": "vcs", "url": "https://github.com/symfony/Icu" },
{ "type": "vcs", "url": "https://github.com/doctrine/common" },
{ "type": "vcs", "url": "https://github.com/php-fig/log" },
{ "type": "vcs", "url": "https://github.com/doctrine/inflector" },
@johnkary
johnkary / default.rb
Last active October 7, 2016 21:52 — forked from philsturgeon/default.rb
Using PHP 5.4 on Ubuntu 12.04.
# Can force this into php/recipes/package.rb
# Or if you're like me and use a cookbook to provision with chef-solo...
# add this near the top of your file before you update apt
# Use PHP 5.4
apt_repository "php54" do
uri "http://ppa.launchpad.net/ondrej/php5-oldstable/ubuntu"
distribution node['lsb']['codename']
components ["main"]
keyserver "keyserver.ubuntu.com"
@callado4
callado4 / behat-phantomjs-webdriver.md
Last active January 24, 2021 17:10
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub"