Skip to content

Instantly share code, notes, and snippets.

View VasekPurchart's full-sized avatar

Vašek Purchart VasekPurchart

View GitHub Profile
@Mikulas
Mikulas / .gitattributes
Created August 10, 2015 08:44
git composer.lock differ
/composer.lock -merge diff=composer.lock
@milo
milo / github-webhook-handler.php
Last active October 29, 2024 15:45
GitHub Webhook Handler
<?php
/**
* GitHub webhook handler template.
*
* @see https://docs.github.com/webhooks/
* @author Miloslav Hůla (https://github.com/milo)
*/
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check
phpunit --log-json php://stdout unit/ | awk '$NF ~ '/,/' && $1 ~ /"(test|time)"/' | cut -d: -f2- | sed "N;s/\n/--/" | sed "s/,//"| awk 'BEGIN{FS="--"}; {print $2 $1}' | sort -r | head -n 20
@lm
lm / index.php
Last active July 24, 2020 15:30
<?php
class AdminerColors
{
function head()
{
static $colors = array(
'127.0.0.1' => '#ED1C24',
'localhost' => '#009245',
@lyrixx
lyrixx / post-checkout
Created June 26, 2013 13:37
Git post checkout
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\e[0m'
@finwe
finwe / indexed_array_reduce.php
Created May 18, 2012 08:48
Array of mixed (usualy objects) to indexed array via array_reduce
<?php
array_reduce(
$objects, // array of objects, arrays...
function ($array, $item) {
$array[$item->getId()] = $item; // $item is current element
return $array; // $array is whole array that will be returned
},
array() // begin with empty array - strict standards
);
@VasekPurchart
VasekPurchart / .bashrc
Last active July 23, 2024 09:11
GIT global configuration and enhancements
# used by Git (commit messages, rebase, ...)
export EDITOR=vim
@dundee
dundee / .bashrc
Last active September 25, 2015 15:37 — forked from lexaurin/gist:943888
Shows actual git branch on command prompt
export PS1="$PS1\$(\
export GIT_BRANCH=\"\$(git branch --no-color 2>/dev/null | grep '*' | cut -d\" \" -f2-)\"; \
if [ -n \"\$GIT_BRANCH\" ] ; then \
echo -en \"\[\033[01;33m\]\"\$GIT_BRANCH \"> \[\033[00m\]\"; \
fi \
)"