Skip to content

Instantly share code, notes, and snippets.

View alekseykorzun's full-sized avatar
🤠
Doing it live

Aleksey alekseykorzun

🤠
Doing it live
View GitHub Profile
@alekseykorzun
alekseykorzun / gist:9901938
Last active August 29, 2015 13:57
Automaticly purge build tags that were cut by Jenkins
# Purge old tags
tag_limit=8
tag_current=`git tag -n |grep -i "jenkins-${JOB_NAME}" | wc -l`
if [ $tag_limit -lt $tag_current ]; then
tag_difference=`expr $tag_current - $tag_limit `
git tag |grep -i "jenkins-${JOB_NAME}" | head -$tag_difference | xargs git push --delete origin
git tag |grep -i "jenkins-${JOB_NAME}" | head -$tag_difference | xargs git tag -d
fi
# Create tag
@alekseykorzun
alekseykorzun / gist:9898360
Created March 31, 2014 18:03
Delete local/remove git branches
; Upstream
git branch | grep -v "master" | xargs git push origin --delete
; Local
git branch | grep -v "master" | xargs git branch -D
@alekseykorzun
alekseykorzun / gist:6444589
Created September 5, 2013 00:33
Proof of concept, segmentation fault (spl_array.c/igbinary.c) when using nested objects.
<?php
/**
* Proof of concept, segmentation fault (spl_array.c/igbinary.c)
* when using nested objects.
*
* PHP 5.3.6, PECL-Memcached 1.x, Igbinary 1.x
*
* @author Aleksey Korzun
*/
@alekseykorzun
alekseykorzun / gist:6099219
Last active February 2, 2021 11:23
Pre-commit hook that supports PHPCS and PHPDOC
#!/bin/bash
################################################################
# Pre commit hook for git
#
# @package: utilities
# @subpackage: utilities\git
# @author: Aleksey Korzun <[email protected]>
################################################################
@alekseykorzun
alekseykorzun / tabstospaces
Created February 14, 2013 17:11
Convert all tabs to spaces within PHP files
find . -name *.php ! -type d ! -name _tmp_ -exec sh -c 'expand -t 4 {} > _tmp_ && mv _tmp_ {}' \;