Skip to main content

Posts

A simple copying directory function

function recurseCopy($src, $dst, $excludeFileType=array()) { $dir = opendir($src); mkdir($dst, 0755, true); while(false !== ( $file = readdir($dir)) ) { if (( $file != '.' ) && ( $file != '..' )) { if ( is_dir($src . '/' . $file) ) { $this->recurseCopy($src . '/' . $file, $dst . '/' . $file, $excludeFileType); } else { $filePathInfo = pathinfo($file); $ext = ''; if(!empty($filePathInfo['extension'])){ $ext = $filePathInfo['extension']; } if(empty($ext) || !in_array($ext, $excludeFileType)){ copy($src . '/' . $file, $dst . '/' . $file); } } } } closedir($dir); }

How to get WordPress posts permalinks using SQL(database) alone

SELECT wpp.post_title, wpp.post_type, wpp.guid, wpp.post_date, CONCAT( wpo_su.option_value, REPLACE( REPLACE( REPLACE( REPLACE( REPLACE( wpo.option_value, '%year%', DATE_FORMAT( wpp.post_date, '%Y' ) ) ,'%monthnum%', DATE_FORMAT( wpp.post_date, '%m' ) ) , '%day%', DATE_FORMAT( wpp.post_date, '%d' ) ) , '%postname%', wpp.post_name ) , '%category%', wpp.post_type ) ) AS permalink FROM wp_posts wpp INNER JOIN wp_options wpo ON wpo.option_name = 'permalink_structure' INNER JOIN wp_options wpo_su ON wpo_su.option_name = 'siteurl' WHERE ( wpp.post_type = 'post' OR wpp.post_type = 'page' ) AND wpp.post_status = 'publish'

A Target campaign

A micro site that allows user to get a free mp3 download after Facebook authentication. The site is written in PHP with MySQL database. Application features: Limits one download per user.  Integration with real-time music purchasing and download. Location restriction by user IP address. Integration with Email injection services. Twitter, Instagram and Facebook user authentication process. Works on both desktop and mobile web browsers. Supports high volume of traffic. moreshakira.target.com

How to resign an IPA with new bundle Id, certificate and entitlements

Create an Entitlements.plist using Xcode Include the following keys values in the plist file.  application-identifier (String) -> 3Q83MXXZGH.com.company.appname get-task-allow (Boolean) -> NO Put the Entitlements.plist in the same folder of the app.ipa file Unpackage the app unzip app.ipa Delete current code signature rm -rf Payload/MyApp.app/_CodeSignature/ Open Payload/MyApp.app/Info.plist in Xcode and update the bundle ID(CFBundleIdentifier) Copy the new .mobileprovision file to Payload/MyApp.app/embedded.mobileprovision Run the codesign command codesign -f -s "iPhone Distribution: Company Certificate" --resource-rules Payload/MyApp.app/ResourceRules.plist --entitlements Entitlements.plist Payload/MyApp.app Repackage the app zip -qr app-resigned.ipa Payload/ Sample Entitlements.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.c

How to add parallax effect to your apps

UIInterpolatingMotionEffect *interpolationHorizontal = [[UIInterpolatingMotionEffect alloc]initWithKeyPath:@"center.x" type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis]; interpolationHorizontal.minimumRelativeValue = @-10.0; interpolationHorizontal.maximumRelativeValue = @10.0; UIInterpolatingMotionEffect *interpolationVertical = [[UIInterpolatingMotionEffect alloc]initWithKeyPath:@"center.y" type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis]; interpolationVertical.minimumRelativeValue = @-10.0; interpolationVertical.maximumRelativeValue = @10.0; UIMotionEffectGroup *interpolationGroup = [[UIMotionEffectGroup alloc]init]; interpolationGroup.motionEffects = [NSArray arrayWithObjects:interpolationHorizontal, interpolationVertical, nil]; if([aView respondsToSelector:@selector(addMotionEffect:)]){ [aView addMotionEffect:interpolationGroup]; }

Experiencing Sencha Touch: VW Dealer app

Sencha Touch, a high-performance HTML5 mobile application framework. We used Sencha to build an iPad application that allows Volkswagen field managers and dealers to show customers everything about VW cars. Application features: Work offline. Update application data without reinstalling the app. Support multiple events. Capture customer information locally and upload to server later on. Vehicle gallery and videos slide show. Vehicle trim specs, color specs, technical specs, pricing. Vehicle comparison.  Since this app needs to work with iPad 1st generation, memory management became very important. We spent good amount of time to tweak the app to have small memory footprint.  The app is being used at places with no wifi. When the application is installed, it downloads all data from a server and stored on the iPad using HTML5 local file system feature. App uses high quality gallery images, so using manifest method would exceed the browser storage limit. The app its