Skip to content

Instantly share code, notes, and snippets.

View voskobovich's full-sized avatar

Vitalii Voskobovich voskobovich

View GitHub Profile
@voskobovich
voskobovich / nginx.conf
Last active February 14, 2016 15:45 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your location block(s):
#
# include cors_support;
#
# A limitation to this method is that Nginx doesn't currently send headers
@voskobovich
voskobovich / cors-nginx.conf
Created February 15, 2016 07:22 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@voskobovich
voskobovich / gist:43f851859c23a8261514
Last active January 7, 2023 10:09
The list of countries with currency (ISO code and symbol) format in SQL.
DROP TABLE currency;
-- Create table variable
CREATE TABLE currency (
country VARCHAR(100),
currency VARCHAR(100),
code VARCHAR(100),
symbol VARCHAR(100)
);
@voskobovich
voskobovich / gist:537b2000108e4781f70b
Last active April 17, 2024 14:57
List of most currency ISO code and symbol format in SQL.
DROP TABLE currency;
-- Create table variable
CREATE TABLE currency (
name VARCHAR(20),
code VARCHAR(3),
symbol VARCHAR(5)
);
ALTER TABLE currency CONVERT TO CHARACTER SET utf8;
@voskobovich
voskobovich / gist:d746899b1488beee69505193dfcc1d46
Created April 3, 2016 16:46
Yii2 Basic Nginx Host Config Example
server {
listen 80;
server_name www.hostname.com;
rewrite ^(.+)$ http://hostname.com permanent;
}
server {
charset utf-8;
client_max_body_size 128M;
@voskobovich
voskobovich / gist:7df1c603d9a0dacfc22930157157f6a2
Last active January 24, 2017 12:01
Yii2 Multilang Toolkit
class UrlManager extends \yii\web\UrlManager
{
/**
* @inheritdoc
*/
public function createUrl($params)
{
//Получаем сформированный URL(без префикса идентификатора языка)
$url = parent::createUrl($params);
# Layout Pjax Begin
--------vew begin----------
# View Pjax Begin
# Menu
# View Pjax End
# View Pjax Begin
# GridView
# View Pjax End
@voskobovich
voskobovich / gist:58a1e0ac9ca44b891f31a0b4433be49b
Last active April 18, 2023 14:40
Replace underscore variables to camelCase in PHP Storm
1. Open document
2. Crtl + R
3. Checked Regexp
4. Find \$(.+)(\w)_(\w)
5. Replace to \$$1$2\u$3
6. Unchecked Regexp
7. Profit!
/**
* Class Controller
* @package backend\extensions
*/
class Controller extends \voskobovich\crud\controllers\Controller
{
/**
* @return array
*/
public function actions()
<?php
namespace dashboard\controllers;
use dashboard\extensions\Controller;
use dashboard\forms\CompanyDeliveryMethodsSearchForm;
use dashboard\forms\CompanyOrderStatusesSearchForm;
use dashboard\forms\CompanyPaymentMethodsSearchForm;
use dashboard\forms\CompanyPhotoDeleteForm;
use dashboard\forms\CompanyPhotoForm;