Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Xerkus's full-sized avatar
:octocat:
Open Sourcing!

Aleksei Khudiakov Xerkus

:octocat:
Open Sourcing!
View GitHub Profile
@Xerkus
Xerkus / gitcheats.txt
Created June 11, 2019 20:33 — forked from chrismccoy/gitcheats.txt
git cheats
# 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
<?php
$subSelect = new Select();
$subSelect
->from(['head_parent' => $this->config->getTable()])
->columns([])
->join(
['parent' => $this->config->getTable()],
new Expression(
'?.? >= ?.? AND ?.? < ?.?',
@Xerkus
Xerkus / Module.php
Last active February 26, 2017 19:05
<?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;
@Xerkus
Xerkus / task.yml
Created June 10, 2014 18:20 — forked from maxim/task.yml
- name: ensure postgresql hstore extension is created
sudo: yes
sudo_user: postgres
shell: "psql {{ postgresql_database }} -c 'CREATE EXTENSION hstore;'"
register: psql_result
failed_when: >
psql_result.rc != 0 and ("already exists" not in psql_result.stderr)
changed_when: "psql_result.rc == 0"
@Xerkus
Xerkus / example.php
Created November 15, 2012 17:50 — forked from ralphschindler/example.php
Zend\Db\Sql\Select example usage
<?php
use Zend\Db\Sql\Select;
// basic table
$select0 = new Select;
$select0->from('foo');
// 'SELECT "foo".* FROM "foo"';