Skip to content

Instantly share code, notes, and snippets.

View tikolakin's full-sized avatar
:octocat:
}</>

Tiko tikolakin

:octocat:
}</>
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<project name="ci-phing-behat-test" default="dev">
<!-- load variable definitions -->
<property file="build.properties"/>
<property name="behat.basedir" value="${project.basedir}/../test"/>
<!-- define custom tasks and types -->
<typedef name="args" classname="phing.behat.types.BehatArguments"/>
#!/bin/bash
PHANTOM_JS="phantomjs-1.9.8-linux-x86_64"
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
else
apt-get update
apt-get install -y build-essential chrpath libssl-dev libxft-dev
apt-get install -y libfreetype6 libfreetype6-dev
apt-get install -y libfontconfig1 libfontconfig1-dev
@tikolakin
tikolakin / grep_lines
Created November 18, 2015 08:36
How to find patterns across multiple lines using grep?
#!/usr/bin/env bash
#If you are willing to use contexts, this could be achieved by typing
grep -A 500 abc test.txt | grep -B 500 efg
#This will display everything between "abc" and "efg", as long as they are within 500 lines of each other.
SELECT table_schema AS "Database name", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;
/**
* Perform mouse hover over specific link or element selector
*
* @Given I hover mouse over :element_link in the :name region
*/
public function hoverMouseOver($element_link, $region) {
$region_obj = $this->getRegion($region);
$el = $region_obj->findLink($element_link);
if(!$el instanceof NodeElement){
$el = $this->findByCssIdOneElement($element_link);
@tikolakin
tikolakin / afterFailedStepsTakeScreenshot.php
Created May 5, 2016 08:08
Take screenshot of a page where step fails.
<?php
/**
* Take screenshot of a page where step fails.
*
* @AfterStep
*/
public function afterFailedStepsTakeScreenshot(AfterStepScope $scope) {
if (\Behat\Testwork\Tester\Result\TestResult::FAILED === $scope->getTestResult()->getResultCode()) {
$driver = $this->getSession()->getDriver();
if ($driver instanceof Behat\Mink\Driver\Selenium2Driver) {
@tikolakin
tikolakin / MySQL_macOS_Sierra.md
Created March 16, 2017 21:30 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@tikolakin
tikolakin / MySQL_macOS_Sierra.md
Created March 16, 2017 21:30 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@tikolakin
tikolakin / curl_code_check.sh
Created February 22, 2018 15:13
check status code with curl
#!/bin/bash
while true
do
STATUS=$(curl -s -o /dev/null -w '%{http_code}' http://www.google.com)
if [ $STATUS -eq 200 ]; then
echo "Got 200! All done!"
break
else
echo "Got $STATUS :( Not done yet..."
@tikolakin
tikolakin / NAV1-101044326
Last active August 3, 2018 15:30
fWhxuHEXvN
{
"mode": "fpm-fcgi",
"geoip_country": "GB",
"country": "US",
"client_ip": "46.119.157.132",
"session_id": "up53he17kq26oojv5u4v884ec6",
"timestamp": "2018-08-03T15:29:15+00:00",
"message": "",
"priority": 7,
"priorityName": "DEBUG",