Skip to content

Instantly share code, notes, and snippets.

Nikolaos Dimopoulos niden

Block or report user

Report or block niden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
niden /
Created Apr 15, 2019 — forked from nikic/
Analysis of some weird evaluation order in PHP

Order of evaluation in PHP

Yesterday I found some people on my [favorite reddit][lolphp] wonder about the output of the following code:


$a = 1;
$c = $a + $a++;
View .htaccess
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L]
niden / makephalcon.bat
Created Mar 30, 2017
Build scripts 7.0
View makephalcon.bat
@set version=%1
@set zip_exe="c:\program files\7-zip\7z.exe"
@set cphalcon=E:\Work\phalcon\cphalcon\build\php7\32bits
@set version70=7.0.5
cd \
@echo -------------------------------------------------
@echo Deleting old files
@echo -------------------------------------------------
niden / commit-msg
Last active Jan 29, 2017
Git hooks
View commit-msg
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_EXCLUDED=$(printf "%s\n" "${BRANCHES_TO_SKIP[@]}" | grep -c "^$BRANCH_NAME$")
BRANCH_IN_COMMIT=$(grep -c "\[$BRANCH_NAME\]" $1)
niden / send.php
Last active Jan 21, 2016
Send file
View send.php
// Send it out to the client
$response = new PhResponse();
->setHeader('Content-Description', 'File Transfer')
->setHeader('Content-Disposition', sprintf('attachment; filename=%s.pdf', $filename))
->setHeader('Content-Transfer-Encoding', 'binary')
->setHeader('Connection', 'Keep-Alive')
->setHeader('Expires', 0)
->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
View Linux Static IP
## Configure eth0
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
View CIDR.php
* CIDR.php
* Utility Functions for IPv4 ip addresses.
* Supports PHP 5.3+ (32 & 64 bit)
* @author Jonavon Wilcox <>
* @revision Carlos Guimarães <>
* @version Wed Mar 12 13:00:00 EDT 2014
niden /
Last active Oct 20, 2018

Keybase proof

I hereby claim:

  • I am niden on github.
  • I am niden_net ( on keybase.
  • I have a public key ASDJ0qujHbHFnf2WFjcFH90ibJjMHHsRkgN18z8FuWQA4Ao

To claim this, I am signing this object:

View PhalconPHPFaceBook.php
"require": {
"facebook/php-sdk" : "*"
Phalcon Bootstrap index.php
View Bootstrap.php
* \NDN\Api\Bootstrap
* Bootstrap.php
* Bootstraps the API application
* @author Nikos Dimopoulos <>
* @since 2012-12-03
* @category Library
You can’t perform that action at this time.