Skip to content

Instantly share code, notes, and snippets.

View allixsenos's full-sized avatar

Luka Kladarić allixsenos

View GitHub Profile
@allixsenos
allixsenos / duznici.php
Created July 31, 2012 13:32
parser za popis duznika - php 5.4
#!/usr/local/php5/bin/php
<?php
$files = glob('*/svi/*.html');
$fields = [];
$fields['po'] = [
'rbr',
'imeprezime',
'mjesto',
@allixsenos
allixsenos / gist:2892164
Created June 7, 2012 22:46 — forked from JosephLenton/gist:2891648
pretty errors
<?
/**
* Pretty Errors
*
* ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
*
* WARNING! It is downright _DANGEROUS_ to use this in production, on
* a live website. It should *ONLY* be used for development.
*
* Pretty Errors allows the outside world to alter your project,
@allixsenos
allixsenos / gist:1281641
Created October 12, 2011 16:01
share on Google+ bookmarklet
javascript:var%20f='https://plusone.google.com/_/+1/confirm?url=',l=document.location,p=encodeURIComponent(l.href);a=function(){if(!window.open(f+p,'sharer','toolbar=0,status=0,resizable=1,width=470,height=330'))l.href=f+p;};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0);}else{a();}void(0);
@allixsenos
allixsenos / gist:1277242
Created October 11, 2011 04:04
tumblr js injection
javascript:d=document;s=d.createElement('style');s.type='text/css';s.innerHTML=".post{-webkit-transition: all 5s ease-in-out; -moz-transition: all 5s ease-in-out; -o-transition: all 5s ease-in-out;}.post:hover{-webkit-transform: rotate(1800deg) scale(1); -moz-transform: rotate(1800deg) scale(1); -o-transform: rotate(1800deg) scale(1);}";d.getElementsByTagName('head')[0].appendChild(s);
@allixsenos
allixsenos / xdebugexception.php
Created September 29, 2011 21:18
xdebug exception fatal
<?php
ini_set("display_errors", 1);
ini_set("error_reporting", E_ALL);
echo "<pre>";
class MyException extends Exception {
function __construct($message) {
parent::__construct($message);
$this->line = "42"; // this triggers it. if it's before the constructor, PHP freaks out regardless of xdebug