techtots.blogspot.com
Tech Tots: August 2013
http://techtots.blogspot.com/2013_08_01_archive.html
Random thoughts on Linux, Java, security and other technical stuff. Thursday, August 15, 2013. Using Drupal's hook theme() for custom theming. This is a short post on how to use Drupal's hook theme(). To customize a layout within your own custom module. Start off with implementing the hook theme() function in your module:. Function theme chat($variables) { $main style = 'chat-holder'; if (isset($variables['is sender']) { if ($variables['is sender'] = TRUE) { $main style .= ' chat-holder-sent'; } else...
techtots.blogspot.com
Tech Tots: February 2014
http://techtots.blogspot.com/2014_02_01_archive.html
Random thoughts on Linux, Java, security and other technical stuff. Tuesday, February 11, 2014. Resizing images in batch using mogrify. Here's a quick way to resize images via shell using mogrify. It's part of ImageMagick package. Mogrify -resize 60% *.jpg. This will resize all files ending with .jpg extension to 60% of their original size. We're only scratching the surface of what mogrify can do. Have fun exploring :). Monday, February 3, 2014. Default Parameter Values in PHP Functions.
techtots.blogspot.com
Tech Tots: March 2012
http://techtots.blogspot.com/2012_03_01_archive.html
Random thoughts on Linux, Java, security and other technical stuff. Tuesday, March 13, 2012. Controlling Mouse Speed in Ubuntu when System Settings Doesn't Cut It (aka xinput). My laptop comes with a Targus cordless mouse which moves too fast even when both Accelleration and Sensitivity in Pointer Speed settings is set to the lowest in Ubuntu. There's another method to control input speed via the xinput. To begin, execute " xinput list. To obtain the list of inputs available:. Mike@myhost: $ xinput list.
techtots.blogspot.com
Tech Tots: Default Parameter Values in PHP Functions
http://techtots.blogspot.com/2014/02/default-parameter-values-in-php.html
Random thoughts on Linux, Java, security and other technical stuff. Monday, February 3, 2014. Default Parameter Values in PHP Functions. Here's a neat way to set some default parameter values in a PHP function. This only works if a function param is passed in as associative array. Function create profile($values) { if (! Is array($values) { $values = array(); } / Default key/values $values = array( 'uid' = NULL, 'username' = ' , 'mobile' = '99999999', 'location' = 'POINT(0 0)', 'fb id' = ' ); }.
techtots.blogspot.com
Tech Tots: January 2014
http://techtots.blogspot.com/2014_01_01_archive.html
Random thoughts on Linux, Java, security and other technical stuff. Tuesday, January 28, 2014. Setting "placeholder" attribute in Drupal 7 form elements. Here's a quick way on how to use HTML5 placeholder attribute in Drupal forms. Example below is altering the login form in a custom theme:. Subscribe to: Posts (Atom). Update Microsoft Windows if Windows Update seems to be 'stuck'. Setting placeholder attribute in Drupal 7 form e.
techtots.blogspot.com
Tech Tots: February 2013
http://techtots.blogspot.com/2013_02_01_archive.html
Random thoughts on Linux, Java, security and other technical stuff. Sunday, February 24, 2013. JavaOne 2012 videos on YouTube. Here's list of videos from the recent JavaOne 2012 symposium:. Http:/ www.theserverside.com/news/thread.tss? Wednesday, February 20, 2013. Configuring Apache and DNS to access site without www prefixawesomehost.com. When hosting a site, it's convenient to just type the domain name e.g. mydomain.com. Instead of pre-fixing it with www. You'll have something like below:. Query OK, 0...
techtots.blogspot.com
Tech Tots: September 2012
http://techtots.blogspot.com/2012_09_01_archive.html
Random thoughts on Linux, Java, security and other technical stuff. Sunday, September 23, 2012. Formatting currency in Drupal Commerce. A project I've been involved in uses Drupal Commerce (DC) to manage currency and products. Here's how to format "normal" values to be DC friendly. Reason for doing so? DC stores amount fields as INTEGER. For instance, an amount of USD99 is stored as 9900 in the table. There are several functions which you need to make this happen. Commerce currency decimal to amount.
techtots.blogspot.com
Tech Tots: Configuring Apache to return CORS headers for Drupal Services
http://techtots.blogspot.com/2014/07/configuring-apache-to-return-cors.html
Random thoughts on Linux, Java, security and other technical stuff. Saturday, July 26, 2014. Configuring Apache to return CORS headers for Drupal Services. Here's what I did to configure Apache to return the proper CORS headers for my webapp consumption which is written in AngularJS:. Having these options should be sufficient. But since I'm using Drupal 7 Services, it doesn't play well with pre-flight call which uses HTTP OPTIONS method. Drupal services will return a 404 even if the correct endpo...Satur...
techtots.blogspot.com
Tech Tots: September 2013
http://techtots.blogspot.com/2013_09_01_archive.html
Random thoughts on Linux, Java, security and other technical stuff. Wednesday, September 11, 2013. Using JMeter's Regular Expression Extractor. Here's how to use JMeter's Regular Expression Extractor post-processor to extract the response from a HTTP Request sampler and use it in the subsequent request. In the screen above, I'm extracting the value of the hidden form element named "t". If there's no match to the regular expression, the default value "NO TOKEN" will be returned. Subscribe to: Posts (Atom).
techtots.blogspot.com
Tech Tots: May 2013
http://techtots.blogspot.com/2013_05_01_archive.html
Random thoughts on Linux, Java, security and other technical stuff. Tuesday, May 28, 2013. Parsing a Base64 encoded image string in PHP. Here's a quick way to parse a Base64 encoded image file to check if it's a proper image file. First, the PHP code:. File encoded = '[very LONG BASE64 STRING]'; $file decoded = base64 decode($file encoded); $info = getimagesizefromstring($file decoded); print r($size);. If the decoded data is a valid image, the getimagesizefromstring(). Monday, May 27, 2013.