Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Open Sourcing!

Aleksei Khudiakov Xerkus

:octocat:
Open Sourcing!
View GitHub Profile
View gitcheats.txt
# shortform git commands
alias g='git'
# get a list of all commit messages for a repo
git log --pretty=format:'%s'
# find the nearest parent branch of the current git branch
git show-branch -a | grep '\*' | grep -v `git rev-parse --abbrev-ref HEAD` | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
# push changes to an empty git repository for the first time
@Xerkus
Xerkus / gist:0c348fb343193eae8a998b3805d4fc21
Created Jun 27, 2018
Check docker image top layer changes with overlay2 fs
View gist:0c348fb343193eae8a998b3805d4fc21
sudo tree "$(sudo docker inspect --format '{{.GraphDriver.Data.UpperDir}}' <image>)"
@Xerkus
Xerkus / files-first.php
Last active Mar 14, 2018
find . -type f | ../test.php
View files-first.php
#!/usr/bin/env php
<?php
$input = stream_get_contents(fopen("php://stdin", "r"));
$files = explode("\n", $input);
$treeFiles = [];
foreach ($files as $file) {
if (empty($file)) {
continue;
}
View ProductController.php
<?php
namespace SpeckCatalog\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class ProductController extends AbstractActionController
{
protected $services = array(
View test.php
<?php
$subSelect = new Select();
$subSelect
->from(['head_parent' => $this->config->getTable()])
->columns([])
->join(
['parent' => $this->config->getTable()],
new Expression(
'?.? >= ?.? AND ?.? < ?.?',
View Module.php
<?php
/**
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application;
use Zend\Mvc\ModuleRouteListener;
View keybase.md

Keybase proof

I hereby claim:

  • I am Xerkus on github.
  • I am xerkus (https://keybase.io/xerkus) on keybase.
  • I have a public key whose fingerprint is 0685 C1EA 2A75 2A47 F205 1D9A 1C2A 28CA 4BA0 08D8

To claim this, I am signing this object:

@Xerkus
Xerkus / VendorNs\Silex\Provider\ViewServiceProvider.php
Created Mar 30, 2016
Extracted ZF2 view registartion for use in silex
View VendorNs\Silex\Provider\ViewServiceProvider.php
<?php
namespace VendorNs\Silex\Provider;
use VendorNs\Silex\View;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Zend\Form\View\HelperConfig as FormHelperConfig;
use Zend\View\Helper\FlashMessenger;
use Zend\View\Resolver as ViewResolver;
@Xerkus
Xerkus / Dockerfile
Last active Feb 2, 2016
Docker image to get vim up and running
View Dockerfile
FROM fedora:23
MAINTAINER Xerkus
RUN dnf -y upgrade && dnf clean all
RUN dnf -y install \
vim \
vim-enhanced \
git \
&& dnf clean all
@Xerkus
Xerkus / bash_history.sh
Last active Mar 23, 2016
Bash completion from history using up and down arrows
View bash_history.sh
export HISTSIZE=""
if [ "$PS1" ]; then
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
fi
You can’t perform that action at this time.