Skip to content

Instantly share code, notes, and snippets.

View vishin-pavel's full-sized avatar

Pavel vishin-pavel

View GitHub Profile
@vishin-pavel
vishin-pavel / backup.sh
Last active July 26, 2020 17:32
Backup/Restore your postgres databases in docker
#Backup your databases
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
@vishin-pavel
vishin-pavel / remove-tag.sh
Created July 3, 2020 21:51
remove git tags by pattern
#remove from origin
git ls-remote --tags --refs origin "v0.0.5*" | cut -f2 | xargs git push origin --delete
#remove local
git tag -d $(git tag -l "v0.0.5*")
@vishin-pavel
vishin-pavel / nginx.conf
Created October 7, 2019 13:37 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@vishin-pavel
vishin-pavel / jwtRS256.sh
Created February 13, 2019 09:06 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@vishin-pavel
vishin-pavel / README.md
Created December 12, 2018 11:58 — forked from cocoastorm/README.md
rexray/s3fs Docker Plugin Install with Minio

Getting Started

Make sure Docker is installed!

Get your Minio endpoint url, accesskey, and secretkey ready!

Install Docker Plugin

docker plugin install rexray/s3fs \
@vishin-pavel
vishin-pavel / index.js
Last active July 12, 2018 07:36
PhpStorm redux duck template
#set ($UppaerCaseModuleName = $ModuleName.toUpperCase())
#set ($capitalizedModuleName = $ModuleName.substring(0,1).toUpperCase() + $ModuleName.substring(1))
import { appName } from '../../../application/config'
import { Record, List } from 'immutable'
import { createSelector } from 'reselect'
import { put, takeEvery, all, call } from 'redux-saga/effects'
/**
* Constants
@vishin-pavel
vishin-pavel / README.md
Created September 19, 2017 09:00 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch <myfile>' \
--prune-empty --tag-name-filter cat -- --all
git push origin --force --all
git push origin --force --tags
@vishin-pavel
vishin-pavel / yii2 autocomplete with id
Created May 19, 2017 07:32
Автокоплит инпут для Yii2 с возмоностью использовать Id вместо значения
<?php
//http://stackoverflow.com/questions/25708344/yii2-autocomplete-save-the-id-instead-of-value
use yii\web\JsExpression;
use yii\jui\AutoComplete;
$data = Company::find()
->select(['name as value', 'name as label','c_id as id'])
->asArray()
->all();
@vishin-pavel
vishin-pavel / YIi.php
Created May 20, 2015 13:21
Кастомный Yii.php для автокоиплита IDE
<?php
/**
* Yii bootstrap file.
* Used for enhanced IDE code autocompletion.
*/
class Yii extends \yii\BaseYii
{
/**
* @var BaseApplication|WebApplication|ConsoleApplication the application instance
*/