Skip to content

Instantly share code, notes, and snippets.

View gharlan's full-sized avatar

Gregor Harlan gharlan

  • Yakamara Media GmbH & Co. KG
  • Frankfurt, Germany
  • X @gregorharlan
View GitHub Profile
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@staabm
staabm / navigation_iterator.php
Last active July 30, 2020 14:07
redaxo navigation iterator
<?php
/**
* Klasse zum Erstellen von Navigationen, v0.1.
*
* benötigt PHP7!
*
* @package redaxo\structure
*/
@tombigel
tombigel / README.md
Last active May 6, 2024 03:23 — forked from a2ikm/limit.maxfiles.plist
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@ostrolucky
ostrolucky / ColumnHydrator.php
Last active January 3, 2022 11:53
Doctrine ColumnHydrator
<?php
declare(strict_types=1);
namespace App\ORM\Hydration;
use Doctrine\ORM\Internal\Hydration\ArrayHydrator;
/**
* Returns one-dimensional scalar array from query: mixed[][] => mixed[]
@madalinignisca
madalinignisca / readme.markdown
Last active August 24, 2022 06:10 — forked from larrybotha/readme.markdown
Postfix Using Mailhog to capture email for web development

Configure Postfix for Localhost SMTP in Mac OSX Mavericks with Mailhog

Using Homebrew install mailhog and enable the service as instructed in the installation.

Open in any browser http://localhost:8025

Edit file /etc/postfix/main.cf

sudo vim /etc/postfix/main.cf
@sindresorhus
sindresorhus / .profile
Created April 6, 2016 11:10 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@jgornick
jgornick / criteria-to-query-builder.php
Created January 28, 2014 16:57
Doctrine: Criteria Array to Doctrine QueryBuilder
<?php
/**
* Recursively takes the specified criteria and adds too the expression.
*
* The criteria is defined in an array notation where each item in the list
* represents a comparison <fieldName, operator, value>. The operator maps to
* comparison methods located in ExpressionBuilder. The key in the array can
* be used to identify grouping of comparisons.
*
@staabm
staabm / parser.php
Created July 18, 2012 08:31
Email conversation parser
<?php
preg_match_all("/^((?:\h*>+\h*)*)(.*)$/m", $s, $matches, PREG_SET_ORDER);
$indent = 0;
$s = '';
foreach ($matches as $match) {
$newIndent = substr_count($match[1], '>');
$diff = $newIndent - $indent;
/*