Search This Blog

Monday 23 November 2015

Mac shortcuts

create a new folder - Command + Shift + N
connect to server - Command + K - to open any shared folder
Spotlight Search - Command + Spacebar
Open a file - Command + O
open task manager to kill - Command+Option+Esc

Friday 20 November 2015

Billing software for small retail stores

Here i am sharing the source code of a billing software i recently did. Its web technologies based with features like, billing, printing and admin page.


Here are the technologies used:

  • HTML
  • CSS
  • Bootstrap 3
  • PHP
  • MySql
  • jquery-ui
using XAMPP server

plugins used:


Development Brief:
  • Started with appendgrid to add items to bill list. its cool and easy to use jquery plugin for creating dynamic tables. Good user guide is provided with it and firm support from the developer alert
  • crypto-js i found easy. used md5 hashing to encrypt and store passwords in mysql db. (genuinely i dont know that we cant password from hash, later i came to know. you are free to use what ever u like by doing the changes in necessary places)
  • for showing items in left panel used jplist for DOM item filtering and pagination purposes. its cool easy to use plugin 
  • Admin tab will be available under options for admin users. through which they can add/change items, users, get stores reports and can see bill reports daily, weekly, monthly and custom dates.
  • admin can export reports to excel. phpexcel is used for writing data to excel from php which is retrieved from mysql
  • Jquery-ui is used for most of the ui parts along with bootstrap. some flaws are there in responsiveness :P ;). works well in all normal sized screens.

Thursday 19 November 2015

View/show/open documents in ionic

To see documents using cordova a plugin is available called DocumentHandler
using this you can directly open a remote files of type pdf,docx,xlsx,ppt,txt

to install the plugin:
ionic plugin add https://github.com/ti8mag/DocumentHandler.git

after installing to view a document use the following snippet:

window.handleDocumentWithURL(function() { console.log('success'); },
                             function(error) { console.log('failure'); if (error == 53) { console.log('No app that handles this file type.'); } },
                             "path-to-file");

path can be a local path or a remote path

if you want to download and then show you need to use FileTransfer and File cordova API's first to get the file and then you can use DocumentHandler plug-in to show a file

ionic plugin add cordova-plugin-file  // file is to choose local storage location
ionic plugin add cordova-plugin-file-transfer // file-transfer to download a file

use the below code to download and show

var fileTransfer = new FileTransfer();
    var uri = encodeURI("http://media.metro.net/riding_metro/bus_overview/images/230.pdf");
    $window.alert("uri:"+uri);
    console.log("uri:"+uri);
    var store = cordova.file.dataDirectory;
    var fileName = "365.pdf";
            fileTransfer.download(
                                  uri,
                                  store+fileName,
                                  function(entry) {
                                  $window.alert("download complete: " + entry.toURL());
                                  console.log("download complete: " + entry.toURL());
                                  window.handleDocumentWithURL(function() { console.log('success'); },
                                  function(error) { console.log('failure'); if (error == 53) { console.log('No app that handles this file type.'); } },
                                  entry.toURL());
                                  },
                                  function(error) {
                                  $window.alert("download error source " + error.source+"download error source " + error.source);
                                  console.log("download error source " + error.source);
                                  console.log("download error target " + error.target);
                                  console.log("upload error code" + error.code);
                                  },
                                  false,
                                  {
                                  headers: {
                                  "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
                                  }
                                  }
                                  );

DocumentHandler gives additional options to share the files. good & easy to use plugin

Note: it uses quicklook framework in ios, and in android it give a list of open with options to open the doc

Wednesday 11 November 2015

Ionic 2 with Angular 2

                Ionic 2 Alpha has been released: http://blog.ionic.io/announcing-ionic-2-0-alpha/ .
As the hardware capabilities are increasing and new technologies have emerged (Specially Angular 2 which is to support new ES6 standard) ionic is working on releasing ionic 2.

Like in Angular 1 is base in ionic 1, Angular 2 in ionic 2. Angular 2 can be scripted in either ES6 or in TypeScript, which is a Microsoft supported language for java script.
As of now no good tutorials are available for angular 2, ionic has done a decent work: http://ionicframework.com/docs/v2/getting-started/installation/
More about angular 2 @ http://ng-learn.org/2014/03/AngularJS-2-Status-Preview/ (I didn’t completely read this, felt little better compared to other posts in net).

My first impressions on ionic/angular 2:
  •       No ng-app, No ng-controller
  •       No two way data binding (big change up to me)
  •       Introduced Components
  •       Services/Providers, Directives will act the same way
  •       Classes, imports, this operator have been introduced
  •       All are custom tags. Dependent completely on directives


Yet to explore….