Thursday, December 31, 2015

ReferenceError: Promise is not defined on gulp build

While going thru getting started guide of polymer starter kit, I run into following issue -

> gulp
[15:12:04] Using gulpfile ~/Apps/js/polymer-playground/example/polymer-starter-kit-1.2.1/gulpfile.js
[15:12:04] Starting 'clean'...
[15:12:04] Finished 'clean' after 18 ms
[15:12:04] Starting 'default'...
[15:12:04] Starting 'copy'...
[15:12:04] Starting 'styles'...

/Users/UserName/Apps/js/polymer-playground/example/polymer-starter-kit-1.2.1/node_modules/gulp-autoprefixer/node_modules/postcss/lib/lazy-result.js:157
        this.processing = new Promise(function (resolve, reject) {
                              ^
ReferenceError: Promise is not defined

    at LazyResult.async (/Users/UserName/Apps/js/polymer-playground/example/polymer-starter-kit-1.2.1/node_modules/gulp-autoprefixer/node_modules/postcss/lib/lazy-result.js:157:31)

The issue is my node version, it needs to be 0.12.5 (it was 0.10.3)

Here are the steps to upgrade -
$ sudo npm cache clean -f
$ sudo npm install -g n
$ node -v
v0.10.35

It still says 0.10.35

Here is the way to switch between versions -

$ sudo n stable
$ node -v
v5.2.0

means Now we can move to 0.12.5 in easy steps -
$ sudo n 0.12.5
$ node -v
0.12.5

Now running gulp build works fine!

Monday, December 28, 2015

pip freeze - unknown revision or path not in the working tre

While trying to get the list of the current package using pip freeze, it throws following error -

> pip freeze
Complete output from command /usr/bin/git rev-parse (detachedfrom0af02a9):
fatal: ambiguous argument '(detachedfrom0af02a9)': unknown revision or path not in the working tree.

Use '--' to separate paths from revisions, like this:

'git [...] -- [...]'

(detachedfrom0af02a9)

----------------------------------------
Command /usr/bin/git rev-parse (detachedfrom0af02a9) failed with error code 128

Storing complete log in /home/youraccount/.pip/pip.log

It's issue with the outdated pip package. To fix the issue -

You can upgrade it with following command -

pip install --upgrade pip

It should fix the issue.

Sunday, December 13, 2015

GO and bee

Get started with Go and Bee framework

brew install go

set following in .bash_profile

export PATH=$PATH:/usr/local/opt/go/libexec/bin
export GOPATH=/Users//goapp

(Instead of username, use path to your home directory)
With this you can access go on command prompt, and when you install bee packages it automatically go to go path you have set.

$ go get github.com/astaxie/beego
$ go get github.com/beego/bee

Install sample file to verify its working

$ cd $GOPATH/src
$ bee new hello
$ cd hello
$ bee run

In case you want to run the application on different port, open app.conf and update the parameters. It's self-explanatory.

You will be able to see the welcome screen.

Monday, December 7, 2015

Sentry Installation in local

Sentry is error logging, aggregation and tracking package. (for both server side, and client side)

mkvirtualenv sentry
workon sentry
pip install sentry --upgrade

sentry init
It will ask for creating conf file in your parent user dir. e.g. /Users//.sentry/sentry.conf.py
vi /home//.sentry/sentry.conf.py > you can review the file

Set SENTRY_ADMIN_EMAIL and SENTRY_URL_PREFIX

SENTRY_ADMIN_EMAIL : ‘your@email.com
SENTRY_URL_PREFIX: ‘http://127.0.0.1:9000

easy_install -UZ sentry[postgres]
Creates postgres db for sentry

sentry --config=/home//.sentry/sentry.conf.py upgrade

you may run into issue with redis connectivity - 127.0.0.1:6379. Connection refused

Check if redis is running -
$ redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>

That means redis is not running, open another terminal and run following command -
$ redis-server

Now if you run the previous command again -
$ redis-cli
redis 127.0.0.1:6379>

Now try to run the upgrade command -

It fails with following error -
Incompatible library version: etree.so requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0

the issue is with libxml2, I resolved using this stack overflow thread -

brew install libxml2
brew install libxslt
brew link libxml2 --force
brew link libxslt --force

It will create all required tables, default user (select it as super user)

Now start sentry -
sentry start

Go to http://127.0.0.1:9000/ to access the local sentry. Get configuration and setup in your project to see the errors get logged on this local sentry instance.

Happy logging!

Sunday, May 17, 2015

xcode intellisense/autocomplete stopped working - How to bring it back?


While doing swift code in Xcode the intenseness suddenly stopped working. How do I bring it back?

Here are few things you can try -


  • Restart the Xcode - you may get lucky and it may start working
  • Next option - Start with Command + Shift + Key and clean the project
  • If its still not working, now we are going little detail, go to /Users/Library/Developer/Xcode/DerivedData
    • Find your project directory for which its broken, delete the content of the folder
    • Other way to do the same is from Xcode, go to Windows > Organize > Delete the Derived data
  • Delete the ModuleCache folder content from the 
    /Users/Library/Developer/Xcode/DerivedData and restart the Xcode, it should come up fine.
Good luck with the fix, let me know if it works or if I should add any additional technique to handle this.

Saturday, May 16, 2015

payment processing gateways and facilitator startups & business in India


Lately there has been buzz on the payment processor companies around the world, and so there so many companies trying to break into the market in India too. Its huge market, though not much regulated and still people rely on cash for most of their transactions/ at least small transactions. 

Here are some of the companies in the space. I'll try to update the list periodically.

Square type of -

ezetap - dongle
mobiswipe - dongle
prizmpayments - payment gateway, ATM
mosambee - dongle (in UAE as well)
aasaanpay - dongle
paypos - dongle
mswipe- dongle
swiftpay - dongle


Payment Gateways-

payU - payment gateway, popular
ebs - payment gateway, Axis bank collaboration, popular
CCAvenue - payment gateway, this one is most successful and most expensive
ZaakPay - payment gateway
DirectPay - payment gateway, times group payment service
payzippy - payment gateway, getting popular because of flipcart
citrus - payment gateway
atom - payment gateway
payumoney - payment gateway
transecute - payment gateway
epaymentglobal - payment gateway
fethr - new one
billdesk - not sure why this one is popular

There are few other services, but can't really understand their stand or competitive advantage over others.


The issues you can smell from the online comments and threads -

Dongle - 

1. Merchants don't have devices (cellphones which can accept the cash).
2. People carrying cash, also some merchant prefer cash.
3. Door to door service while setting it up and spread knowledge of the advantages, though if its executed sophistically, it sure has a good future. At the same time it requires proactive merchants who are willing to do technology way, which anyway going to be future. 

For the payment gateways 
- The integration takes at least 3 weeks, which is really bad. Unlike stripe its mostly a day or two.
- On top of none of them are transparent in terms of the charges. Lot of different charges and for someone to setup online store withpayment gateway is really tough. Thats why people rely on Shopify, which makes it little bit easy. even after integrating payU, its such an awful service you can read in the comments
- Here is some comparison between leading payment gateways, and some more (Its little older so some already been demised).
- Also banks like ICICI, HDFC and AXIS have their own gateways.
- The most common complain is none of them are responsive, if anything happens you cant reach the support and sometimes for months. 

Keyboard stopped working in xcode simulator

While doing some first time coding on xcode first time I run into an issue where suddenly my keyboard stopped working when select of text box. 

Why it happened?
Because first time when the textbox opened, you might have clicked on escape and what it will do is it connects the simulator keyboard to your hardware keyboard instead of simulator keyboard.

How to enable again?
For your simulator follow below steps:

iOS Simulator > Hardware > Keyboard

Uncheck "Connect Hardware Keyboard"

It will disconnect the hardware keyboard connection for the simulator.