Author: Konrad Fedorczyk

  • Permission denied when script is trying to execute ps_files_cleanup_dir

    Permission denied when script is trying to execute ps_files_cleanup_dir

    This is pretty common problem. I’ve encountered it on recent version of the Debian operating system. When you see something like that: Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5/sessions) failed: Permission denied (13) in /mnt/www-data/htdocs/raportMNW/inc/bryanjhv/slim-session/src/Slim/Middleware/Session.php on line 110 You can fix that easily with following Linux commands: sudo nano /etc/php5/apache2/php.ini Now use CTRL+W to find following string session.save_path and configure it […]

  • SEO Friendly Gists

    SEO Friendly Gists

    In case you ever wondered if Github’s Gists are indexed when they are embedded on your website, ther aren’t 🙂 But there is a simple tool to avoid loss of traffic from Google. Go to http://seo-friendly-gist.herokuapp.com/ and simply paste your gist’s id into form on this website. It will generate code that you should paste unchanged  to your […]

  • How to change mass edit limit in Vtiger 6.5

    How to change mass edit limit in Vtiger 6.5

    Sometimes you need to make mass operation on houndreds of records in Vtiger. Well in this case it’s 500 ones maximum… Well this is kinda stupid because it can surely handle up to thousands. How do I know? I’ve hacked the code and successfully converted 2000 leads 🙂 Well it takes some time but it […]

  • How to setup pushover alert on logon event in Windows

    How to setup pushover alert on logon event in Windows

    In this post I’ll show you how to configure Pushover with Windows server. In this specific case it will notify you when someone logs onto your machine.

  • Log model error after save

    Log model error after save

    This code: $model = new SomeModel(); $model->attributes = $attributes; $model->save(); Yii::log(“errors saving SomeModel: ” . var_export($model->getErrors(), true)); Will log: 2014/07/31 22:57:59 [info] [application] errors saving SomeModel: array ( ‘date’ => array ( 0 => ‘Date cannot be blank.’, ), )

  • How to position element absolute but inside its container?

    How to position element absolute but inside its container?

    This trick will help you place element inside its cointainer using absolute positioning. Very often you want to be very precise when placing elements. It is very hard/impossible when you anchor to entire window because browser resizing is messing everything up. To avoid this, simply set relative positioning to the wrapper element. Check demo.

  • Reversed version of cycle2 plugin Scroll Vert

    Reversed version of cycle2 plugin Scroll Vert

    This is reversed version of the Cycle2 plugin used to animate slides vertically. In my version animation goes from bottom to top. Download reversed version from Github: https://github.com/fedek6/ScrollVert-reverse Download original version and check documentation at: http://jquery.malsup.com/cycle2/demo/scrollVert.php

  • jQuery UI dialog with form fields passing data into single input

    jQuery UI dialog with form fields passing data into single input

    I’ve recently ran into this scenario: there is a single input field with dimensions in a height x width x depth format. What we can do to force/guide user to use propper format?

  • Simpliest way to obfuscate e-mail address using jQuery

    Simpliest way to obfuscate e-mail address using jQuery

    Here is a simpliest jQuery code to protect e-mail addresses on your website from spam bots. Just put this in a script tag into the head section: $(window).load(function() { // anti spam var r=’random-string’; $(‘.’+r).each(function() { var $this = $(this), value = new String($this.text()); value = value.replace(‘[‘+r+’]’, ‘@’); $this.replaceWith($(”).text(value).attr(‘href’, ‘mailto:’+value)); }); }); Now replace random-string with any […]

  • How to programmatically select option in a HTML list using jQuery?

    How to programmatically select option in a HTML list using jQuery?

    This is very simple solution to select specified option in a HTML select list. You just need to use the val function on a select element to set it’s value. It’s simple like that: $(‘select#identificator’).val(‘value of existing option value’); Check working example on the JSFiddle: http://jsfiddle.net/fedek6/B3Ehj/