Skip to content

Instantly share code, notes, and snippets.

<?php
add_filter('authenticate', function($user, $username, $password){
$userId = $user;
if ($user instanceof WP_User) {
$userId = $user->ID;
}
ataccama_permissions_setUserPermissions($userId);
return $user;
}, 20,1);
@heiglandreas
heiglandreas / gist:587fc245499e83721335
Created January 8, 2016 09:37
Blockchain-Verification
Verifying that +heiglandreas is my blockchain ID. https://onename.com/heiglandreas
@heiglandreas
heiglandreas / time is an illusion.md
Last active February 17, 2016 19:55
time is an illusion (lunchtime doubly so)

Have you ever read a "Good morning" in an international IRC-Channel shortly before you leave the office for lunch? In international business time is an illusion. In this talk we'll dive into he depths of Timezones and how to handle them. We'll talk about the history of timezones to see why they are so important. And of course we'll examine how to handle those little buggers efficiently in code and database.

@heiglandreas
heiglandreas / gist:86d2b3d4b86dcb1e2b82c09008d361fe
Last active March 29, 2016 18:49
npm install for callingallpapers.com
vagrant@vagrant-ubuntu-trusty-64:/vagrant$ npm install
npm WARN package.json callingallpapers.com@0.1.0 No README data
npm http GET https://registry.npmjs.org/grunt-uncss
npm http 304 https://registry.npmjs.org/grunt-uncss
npm http GET https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/uncss
npm http GET https://registry.npmjs.org/maxmin
npm http 304 https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/maxmin
npm http 304 https://registry.npmjs.org/uncss
@heiglandreas
heiglandreas / GamifyYourDeveloperGrowth.md
Last active April 1, 2016 07:46
Gamify your growth as a developer?

I love to get better as a developer and when I get rewarded for that even better! In this session we'll have a look at ten tools that make our lives as developers easier and along the way allow us to become better as a developer. Services like Github or Bitbucket allow us to communicate with one another about code while Scrutinizer, Code-Climate or Insight can give us valuable informations on how to improve our coding skills and easily bring our code to a better level. Suddenly tedious tasks like writing unittests, reducing cyclomatic complexity and adding documentation can become entertaining and rewarding. All this because we all strive to get high marks, 100% or a green button. So let's see what the benefits of the different tools are and how we can integrate them into our build-chain.

@heiglandreas
heiglandreas / .gitignore
Created April 18, 2016 19:06
Self signed certs without storing the cert in the repo
myrootca.crt
@heiglandreas
heiglandreas / ErrorHandler.php
Created April 29, 2016 05:53
Fix BC-Issue in Zend\Ldap 2.7.0
<?php
namespace Acme;
class ErrorHandler implements Zend\Ldap\ErrorHandlerInterface
{
public function startErrorHandling($level = E_WARNING)
{
set_error_handler(function($errNo, $errMsg){});
}
@heiglandreas
heiglandreas / README.md
Created May 10, 2016 11:09
How to install a dependency that depends on a dev-dependency

The issue:

Given a project that has the minimum-stability set to "stable" and a dependency of the project - itselv being stable - has a dependency to a dev-version of a lib.

How can one use composer require to install that lib without having to prepare the composer.json before by adding the dependencies dependency as @dev as described here.

As an example you can use the given composer.json and shell-command to test that issue. But it does not seem to be limited to that case.

@heiglandreas
heiglandreas / expectedResult
Created May 23, 2016 05:30
DST-Issues in PHPs Date-Component
2016-10-30T01:30:00+02:00
2016-10-30T02:30:00+02:00
2016-10-30T02:30:00+01:00
2016-10-30T03:30:00+01:00
# Get the current GIT-Branch-name in brackets
function parse_git_branch_and_add_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/'
}
# Set the current IP-Address to the variable IP
IP=$(route -n get default|grep interface|cut -b 14- | xargs ipconfig getifaddr);
#
# Set the Prompt to the following:
# username@ip-address currentDirectory gitBranchIfExists
export PS1="\u@\[\033[1;31m\]$IP\[\033[0m\] \W\[\033[33m\]\$(parse_git_branch_and_add_brackets)\[\033[0m\] \$ "