Skip to content

Instantly share code, notes, and snippets.

View kubk's full-sized avatar

Egor Gorbachev kubk

View GitHub Profile
@foaly-nr1
foaly-nr1 / DateRangeType.php
Last active July 31, 2018 22:23 — forked from havvg/DateRange.php
Symfony2: poor man's date_range form type
<?php
namespace Ormigo\Bundle\OrmigoBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
@mylk
mylk / TimezoneType.php
Last active November 9, 2018 18:04
A modified Symfony Forms "timezone" type that also displays the timezone offset
<?php
/**
* A modified version of the original symfony form type that adds the timezone offset.
*
* Original version at:
* https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Form/Extension/Core/Type/TimezoneType.php
*/
/*
* Installation:
@obenjiro
obenjiro / talks.md
Last active April 17, 2021 19:17
Доклады - Алексей Охрименко
@SiZapPaaiGwat
SiZapPaaiGwat / webpack.nginx.conf
Last active November 19, 2021 19:10
webpack-dev-server configuration in nginx on development server
upstream ws_server {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name 10.1.2.225;
location / {
proxy_pass http://ws_server/;
@fesor
fesor / pre-commit
Last active March 16, 2022 06:12
php-cs-fixer pre-commit hook
#!/usr/bin/env bash
echo "php-cs-fixer pre commit hook start"
PHP_CS_FIXER="bin/php-cs-fixer"
PHP_CS_CONFIG=".php_cs"
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php')
if [ -n "$CHANGED_FILES" ]; then
$PHP_CS_FIXER fix --config "$PHP_CS_CONFIG" $CHANGED_FILES;
git add $CHANGED_FILES;
@thomaswmanion
thomaswmanion / add-hmr.sh
Last active April 18, 2022 20:01
Add HMR to Angular CLI
createEnvFile() {
production=$1
hmr=$2
file=$3
echo "export const environment = {" > $file
echo " production: $production," >> $file
echo " hmr: $hmr" >> $file
echo "};" >> $file
}
@danielgynn
danielgynn / gulpfile.js
Last active August 16, 2022 09:06
Example gulpfile from the 'Automating your build tasks easily with Gulp.js' article.
var gulp = require('gulp'); // Require gulp
// Sass dependencies
var sass = require('gulp-sass'); // Compile Sass into CSS
var minifyCSS = require('gulp-minify-css'); // Minify the CSS
// Minification dependencies
var minifyHTML = require('gulp-minify-html'); // Minify HTML
var concat = require('gulp-concat'); // Join all JS files together to save space
var stripDebug = require('gulp-strip-debug'); // Remove debugging stuffs
@jesgs
jesgs / deploying-from-github-to-vps-using-travis-ci.md
Last active September 12, 2022 19:39
Deploying from Github to VPS using Travis CI

From: https://www.jesgs.com/blog/2017/12/18/deploying-from-github-to-vps-using-travis-ci

Recently, I spent around 14 to 16 hours learning all of the necessary steps to getting an existing repo set up with Travis CI to run unit tests, and then once successful, connect to a remote server that isn't a PaaS (in this case, Linode) and then proceeds to use Git hooks to do post deployment things.

Starting with your local machine and you have your project already checked out from Github.

Setting Up

  • Assuming you have Ruby (at least 2.3.1) installed, run gem install travis. This installs the Travis CI command-line tools. We're going to use these tools to encrypt RSA keys that Travis will use to connect to your remote server.
  • This tutorial also assumes that you have a working repo and a Travis-CI account set up.
@codedokode
codedokode / задача-сайт-testhub.md
Last active January 24, 2023 14:44
Сайт для тестирования TestHub

Задача

Примечание: раньше тут были другие условия задачи. Их можно найти в предыдущих ревизиях этого задания по ссылке https://gist.github.com/codedokode/8733007/e8e73b0255b3d899cb4e17dc9446fe694a8f5f7c

Cделать сайт TestHub, который позволяет создавать и проходить тесты (с вопросами и ответами). Их могут использовать например, преподаватели для проверки знаний студентов, работодатели для отсеивания кандидатов на вакансию, маркетологи для проведения опросов. Далее мы будем называть того, кто создает тесты, экзаменатором, а того, кто сдает, студентом, это лишь условные названия.

  • Предлагаемые технологии: фреймворк (Symfony 3-4 (сложнее, но интереснее), Yii2, Laravel), MySQL или Postgres, шаблонизатор Twig, ORM Doctrine
  • Время выполнения: все зависит от тебя, но я бы смотрел на 4-6 недель
  • Уровень: очень продвинутый новичок
  • Требуемые знания: PHP, MVC, ООП, HTML/CSS, SQL, основы JS