Skip to content

Instantly share code, notes, and snippets.

@glensc
glensc / .gitignore
Last active Mar 11, 2021
RFC: Reproducible vendor directory contents #9768
@glensc
glensc / README.md
Last active Oct 11, 2018
Create Docker image tag using Registry v2 API
View README.md
@glensc
glensc / .gitignore
Last active Jan 16, 2019
brew and phpXY in PATH
@glensc
glensc / .gitignore
Last active Jul 24, 2017
fedmsg and reactor.callLater issue
View .gitignore
*~
*.py[co]
/*.egg-info/
@glensc
glensc / README.md
Last active May 17, 2017
PHPStorm Launch Wrapper
View README.md

PHPStorm Launch Wrapper

Wrapper that allows to open projects from commandline:

$ phpstorm ~/projects/awesome-project

Download this snippet and install into your $PATH

@glensc
glensc / .gitignore
Last active May 12, 2017
PEAR repository type does not process PEAR installer dependency #6413
View .gitignore
/composer.lock
/vendor/
@glensc
glensc / pre-commit
Last active May 13, 2017
php-cs-fixer git pre commit hook
View pre-commit
#!/bin/sh
# A git pre-commit hook to run php-cs-fixer on all changed php files.
#
# Inspired from https://gist.github.com/jwage/b1614c96ea22ccaf68b7
#
# Author: Elan Ruusamäe <glen@pld-linux.org>
# Date: 2017-05-03
# URL: https://gist.github.com/glensc/cf03265205b67f3735b6fb19ccd4ab2a
set -e
@glensc
glensc / index.php
Created Apr 20, 2016
GitHub Push Hook PHP Handler
View index.php
<?php
// https://developer.github.com/webhooks/
// ruby -rsecurerandom -e 'puts SecureRandom.hex(20)'
define('HOOK_SECRET', '');
set_exception_handler(function($e) {
header('HTTP/1.1 500 Internal Server Error');
error_log(basename(__FILE__, '.php') . ': '. $e->getMessage());
die("Error on line {$e->getLine()}: " . htmlspecialchars($e->getMessage()));
@glensc
glensc / slack-svn-hook.py
Last active Jan 31, 2017
Subversion integration with Slack
View slack-svn-hook.py
#!/usr/bin/python
# Script for Subversion integration with Slack
#
# Uses slackweb module:
# https://github.com/satoshi03/slack-python-webhook
# 1. Save this file in /usr/bin as slack-svn-hook
# 2. Make it executable:
# chmod +x /usr/bin/slack-svn-hook
# 3. Put this line at the end of file of your_svn_repo/hooks/post-commit:
@glensc
glensc / post-checkout
Last active Jan 23, 2018
auto update composer on git branch switch
View post-checkout
#!/bin/sh
# https://git-scm.com/docs/githooks
#
# This is hook that updates composer
# if branch change included change in composer.json
#
# additionally, if vendor dir is under (separate!) git repo,
# the result can be speed up by switching and keeping git branch up to date
# there as well.