Skip to content

Instantly share code, notes, and snippets.

@glensc
glensc / .gitignore
Last active May 12, 2017 08:39
PEAR repository type does not process PEAR installer dependency #6413
/composer.lock
/vendor/
@glensc
glensc / pre-commit
Last active May 13, 2017 08:58
php-cs-fixer git pre commit hook
#!/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 / README.md
Last active May 17, 2017 09:40
PHPStorm Launch Wrapper

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 July 24, 2017 06:25
fedmsg and reactor.callLater issue
*~
*.py[co]
/*.egg-info/
@glensc
glensc / README.md
Last active October 11, 2018 16:31
Create Docker image tag using Registry v2 API
@glensc
glensc / .gitignore
Last active March 11, 2021 22:03
RFC: Reproducible vendor directory contents #9768
/vendor/
@glensc
glensc / message_json_parser.py
Last active June 27, 2021 12:18 — forked from multun/message_json_parser.py
Pretty-print a facebook message.json, fixing up broken encoding
#!/usr/bin/env python3
import sys
import json
import warnings
from datetime import datetime
def fixup_str(text):
return text.encode('latin1').decode('utf8')
@glensc
glensc / .gitignore
Last active August 23, 2022 11:57
brew and phpXY in PATH
*~
/php??
@glensc
glensc / post-checkout
Last active June 15, 2023 21:35
auto update composer on git branch switch
#!/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.