Skip to content

Instantly share code, notes, and snippets.

View ihabunek's full-sized avatar

Ivan Habunek ihabunek

View GitHub Profile
@ihabunek
ihabunek / gist:468ccda3ca4b2052ab83
Last active August 29, 2015 14:21
Tjedan dobrih restorana 2015
2015-06-15T16:44:34+02:00 | DEBUG | 557ee4d258b0c | de | | Opendi\Api\Application | Processing: POST http://api-staging.opendi.com/de/listings/31474/reviews
2015-06-15T16:44:34+02:00 | DEBUG | 557ee4d258b0c | de | Opendi AG | Opendi\Api\Application | Request authenticated for: Opendi AG
2015-06-15T16:44:34+02:00 | ERROR | 557ee4d258b0c | de | Opendi AG | Opendi\Api\Application | Failed executing query: "INSERT INTO bewertung (eintrag_id, bewertungtyp_id, aktiv, aktivstack, countable, name, bewertedname, rating, ratingscaled, ratingstars, numstars, ratingtitle, ratingtext, ratingurl, exteintragurl, bildname, datum, sourceeintragid, sourceratingid, locked, locktime, created, lastmodify, login_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);" with arguments: ["31474","sbb",true,false,true,"Juice","Some stuff",5,5,5,5,"Kinda liked it","It was better than some things, worse than others.","google.com","duckduckgo.com",null,"2014-02-22 09:01:25",null,"11031",null,null,null,null,n
@ihabunek
ihabunek / gist:47eed8bb22808b092301
Created June 26, 2015 06:25
Changes to PHP wiki
====== Build your own PHP on Windows ======
===== Before you Begin =====
Building PHP on Windows will require three things
- A properly set up build environment, including a compiler with the right SDK's and some binary tools used by the build system
- Prebuilt libraries and headers for third party libraries that PHP uses in the correct location
- The PHP source
===== The Build Environment =====

From: noreply@services.dlh.de

Dear Mr. Habunek,

thank you for your request.

Passenger Receipts issued by Lufthansa German Airlines (DLH AG) count as tickets in accordance with German law (§ 34 UStDV) and therefore are valid invoices as defined by §14 German Sales Tax Law.

According to § 34 UStDV tickets must contain the following minimum information:

  • the full name and complete address of the contractor executing the transportation service
@ihabunek
ihabunek / gist:3504123
Created August 28, 2012 20:45
A quick checker for hashes
from os.path import join, splitext, basename
import os
import sys
import hashlib
def file_get_contents(path):
with open(path, 'rb') as file:
return file.read()
for root, dirs, files in os.walk('.'):
@ihabunek
ihabunek / table_dump.php
Created September 7, 2012 09:43
table_dump(): One of my favourite PHP debug functions.
<?php
/** Number of spaces to leave between columns. */
define('TABLE_DUMP_COLUMN_PADDING', 3);
/** Maximum number of chars in a column. Longer values will be trucnated. */
define('TABLE_DUMP_COLUMN_MAX_LENGTH', 50);
/**
* Takes an array of arrays, such as table data from a database and
@ihabunek
ihabunek / rolling.php
Created October 11, 2012 19:34
Testing rolling appender
<?php
include('../src/main/php/Logger.php');
Logger::configure(array(
'appenders' => array(
'default' => array(
'class' => 'LoggerAppenderRollingFile',
'layout' => array(
'class' => 'LoggerLayoutPattern',

For a person who prefers Flask so much, @gperetin sure does talk a lot about Django.

import urllib2
import re

url = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=gperetin&count=200"
data = urllib2.urlopen(url).read()

print len(re.findall('django', data, re.I))
<?php
require 'vendor/autoload.php';
Logger::configure(array(
'appenders' => array(
'default' => array(
'class' => 'LoggerAppenderFile',
'layout' => array(
'class' => 'LoggerLayoutSimple',
@ihabunek
ihabunek / gist:5964568
Created July 10, 2013 08:48
List of phormium limitations to be incorporated into the documentation
* table columns should be only lowercase, mixed case can be problematic for PDO