Skip to content

Instantly share code, notes, and snippets.

@o-shabashov
o-shabashov / php.php
Created May 29, 2016 22:52
Arrays '+' VS Yii2 ArrayHelper::merge
<?php
// $arr1
Array
(
[a] => 1
[b] => 2
[c] => 3
)
// $arr2
@o-shabashov
o-shabashov / nginx.conf
Last active December 27, 2018 07:25
Nginx 1.10.* + LetsEncrypt SSL (A+) + HTTP/2 + PHP7-FPM + Force HTTPS sample config
server {
listen 80;
server_name domain.com;
root /var/www/domain.com;
location ~ /.well-known {
allow all;
}
location ~ /\.ht {
@o-shabashov
o-shabashov / UserQuery.php
Created May 30, 2016 09:23
Yii2 today scope in ModelQuery
<?php
namespace app\models;
/**
* This is the ActiveQuery class for [[User]].
* @see User
*/
class UserQuery extends \yii\db\ActiveQuery
{
/**
@o-shabashov
o-shabashov / composer.md
Created June 6, 2016 06:30
Composer set Github auth token from console

composer config -g github-oauth.github.com <oauthtoken>

This shit really needs to be documented somewhere.

#!/usr/bin/env python
import sys, os, re
from subprocess import check_output
# Collect the parameters
commit_msg_filepath = sys.argv[1]
if len(sys.argv) > 2:
commit_type = sys.argv[2]
else:
@o-shabashov
o-shabashov / dev
Created May 15, 2017 04:27
/etc/resolver
nameserver 127.0.0.1
port 53535