Skip to content

Instantly share code, notes, and snippets.

View okovalov's full-sized avatar
🏠
Working from home

Oleksandr Kovalov okovalov

🏠
Working from home
View GitHub Profile
<?php
require_once __DIR__.'/../vendor/autoload.php';
require_once __DIR__.'/boot.php';
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
use Synfony\Component\HttpFoundation\Response;
$app = new Application();
@okovalov
okovalov / ant-composer.xml
Created August 22, 2016 17:03 — forked from cpliakas/ant-composer.xml
Apache Ant tagets for Composer commands.
<?xml version="1.0" encoding="UTF-8"?>
<project name="Composer Targets" default="build">
<property name="builddir" value="${basedir}/build"/>
<property name="composer" value="${builddir}/composer.phar"/>
<target name="php-check">
<condition property="php" value="php">
<not>
<isset property="${php}"/>
@okovalov
okovalov / gist:7a233858653e69b64bf4d5c23adb3f60
Created September 1, 2016 20:20 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@okovalov
okovalov / gist:1207185e1d93567f8470e41f9405ad26
Created September 8, 2016 16:55 — forked from robertfyffe/gist:8315921
HTML: Starting Template
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<link rel="stylehsheet" href="">
</head>
<body>
</body>
@okovalov
okovalov / sample.js
Created September 9, 2016 17:39 — forked from chrisabrams/sample.js
Bluebird promise chain example
Promise = require('bluebird')
var A = function() {
return new Promise(function(resolve, reject) {
var result = 'A is done'
console.log(result)
resolve(result);
})
@okovalov
okovalov / pre-commit
Last active October 6, 2016 14:55 — forked from CamdenSegal/pre-commit
Run phpunit pre-commit stop commit if failed.
#!/usr/bin/php
<?php
## SETUP
$isPhpCsPass = false;
$isPhpMdPass = false;
$isPhpUnitPass = false;
## PHPCS
@okovalov
okovalov / !README.md
Created March 3, 2017 14:59
Binary Bot (https://bot.binary.com) Sample Price Actions
@okovalov
okovalov / .bash_profile
Created April 13, 2018 17:37 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@okovalov
okovalov / get_combinations.php
Created October 6, 2018 01:25 — forked from cecilemuller/get_combinations.php
PHP: Get all combinations of multiple arrays (preserves keys)
<?php
function get_combinations($arrays) {
$result = array(array());
foreach ($arrays as $property => $property_values) {
$tmp = array();
foreach ($result as $result_item) {
foreach ($property_values as $property_value) {
$tmp[] = array_merge($result_item, array($property => $property_value));
}