Skip to content

Instantly share code, notes, and snippets.

View zillingen's full-sized avatar

Dmitry Zakharov zillingen

  • Russia, Moscow
View GitHub Profile

Dockerfile for php-fpm image with mongodb, postgres and mysql

FROM php:7.4-fpm

RUN apt-get update \
  && apt-get install -y \
             apt-utils \
             man \
             curl \
@zillingen
zillingen / vimrc
Last active April 9, 2018 18:13
My ~/.vimrc file
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@zillingen
zillingen / seo_tags.twig
Last active April 9, 2018 18:40
Twig markup for Open Graph and other SEO tags
{# Open Graph #}
<meta property="og:title" content="{{ page.title }}" />
<meta property="og:type" content="{{ isArticle ? 'article' : 'website' }}" />
<meta property="og:url" content="{{ page.url }}" />
<meta property="og:image" content="{{ page.image }}" />
<meta property="og:description" content="{{ page.description }}" />
{% if isArticle is true %}
<meta property="article:published_time" content="{{ page.publishedAt }}" />
<meta property="article:modified_time" content="{{ page.modifiedAt }}" />
@zillingen
zillingen / jsonld_article.twig
Created February 11, 2018 14:33
JSON-LD Article markup for Bolt CMS
{# JSON-LD Article markup #}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Article",
"headline": "{{ article.title }}",
"description": "{{ article.teaser|default('') }}",
"mainEntityOfPage": "{{ absolute_url(article.link()) }}",
"author": "{{ article.user.displayname }}",
"datePublished": "{{ article.datepublish }}",
@zillingen
zillingen / php-curl.md
Last active December 8, 2017 07:59
PHP cURL usage examples

GET request with headers

Sending HTTP GET request containing Authorization headers to public REST API with PHP cURL

function curlGetRequest() {
    $ch = curl_init();

    $headers = array(
 'Authorization: OAuth XXX,
@zillingen
zillingen / silex-php.md
Last active November 22, 2017 18:38
Silex PHP framework gists

Doctrine DBAL base config

<?php
// app/config/db.php

// db config
$app['db.options'] = [
  'driver'   => 'pdo_mysql',
  'host'     => 'localhost',
@zillingen
zillingen / css-base.css
Last active November 19, 2017 18:19
CSS base styles
/* Base Margins */
.m-0 { margin: 0 !important; }
.m-1 { margin: .25rem !important; }
.m-2 { margin: .5rem !important; }
.m-3 { margin: .75rem !important; }
.m-4 { margin: 1rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: .75rem !important; }
@zillingen
zillingen / mysqldump.md
Last active November 3, 2017 19:50
Backup and restore MySQL database with mysqldump

Backup and restore MySQL database with mysqldump

Create database dump:

mysqldump -uroot database_name > dump.sql

Restore database dump to mysql:

@zillingen
zillingen / NPM_behind_proxy_in_Windows.md
Last active November 28, 2023 15:22
How to setup npm proxy settings behind proxy on Windows

Setup npm behind HTTP and HTTPS proxy on Windows

How to setup npm proxy settings behind HTTP and HTTPS proxy on Windows

Create .npmrc in home dir

In your user home dir create file .npmrc with your username and password:

proxy = http://user:password@your.proxy.server:8080

Работа с Git

Создание локального репозитория

git init

Настройка User Name and User Email

git config --global user.name "admin"