Thursday, November 23, 2017

Quick setup Phonegap Development Environment using Docker

INTRO


NOTE : Pre-requisite is to have ubuntu 16.04

Following DIGITAL OCEAN tutorial for same ... it worked for me on multiple machines
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04

Lets start by insalling DOCKER

INSTALLATION COMMANDS :
1
2
3
4
5
6
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker

FIND, DOWNLOAD & RUN a relevant DOCKER image :
1
2
3
4
docker search phonegap
docker pull geekyhouse/phonegap-android-starter
docker images -a
docker run -i -t geekyhouse/phonegap-android-starter /bin/bash

Friday, September 1, 2017

Quick post: [termux] C and C++/Cpp code execution

Everybody here are the steps to start c/c++ coding in termux

1) Install package using following command

apt-get install clang

2) Sample C code
#include <stdio.h>                                                    int main(){                                        
printf("Hello World!");              
return 0;
}

3) Run using
gcc helloWorld.c

4) View output using
./a.out

5) Sample cpp/c++ code
#include <iostream>                                            using namespace std;                                          
int main() {
std::cout << "Hello, World!";
    return 0;                                         
}

6) Running cpp code
g++ helloWorl.cpp

7) View output using
./a.out

Wednesday, August 16, 2017

Quick Post : Vi Editor Basics (Dedicated to my dear siblings)

In terminal go to your desired filepath
Then type following command to start editing your file
vi filename.ext

This shall open the editor and you will see multiple lines with tilde(~) symbol

Next you will need to press i to start actually typing into file (untill then you are in read mode)

Now type your contents

Press esc and type :

This allows you to enter commands to vi editor
For saving and closing the editor you will type wq and press enter
To avoid saving you can type q!
Remeber when you press esc you again enter into readonly mode, and you can use arrow keys to move inside document.

Other main operations are
1) Copy
Go to line that you wish to copy
Press esc, Press yy to copy single line
Note: To copy 3 lines you can say y3y and so on

2) Cut
Go to line that you wish to cut
Press esc, Press dd to cut single line
Note: To cut 3 lines you can say d3d and so on

3) Paste
Go to line after which you wish to paste content from above two commands and press p

4) Search string
Press Esc
Type / followed by string you wish to find
Ex. /hello

.... Will add more as I recall

Tuesday, July 18, 2017

Quick Post : Yii Boostrap theme integration

For this you need to create a Yii project and then clone theme into its themes folder...

We need yii framework zip downloaded and extracted at some location and LAMP/MAMP/AAMP etc. preconfigured.


This can be done by using following commands

php yii-1.1.16/framework/yiic.php -webapp development/phpProjects/yii/boostrap3Theme

cd development/phpProjects/yii/boostrap3Theme/themes/

git clone https://github.com/amnah/yii-bootstrap-starter-theme.git

We need to configure the theme in configuration of app i.e. main.php located at protected/config/main.php location.

It does not have theme parameter added by default we need to configure it by adding 'theme'.

Before
return array(
 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
 'name'=>'My Web Application',
 'theme'=>'yii-bootstrap-starter-theme',


After
return array(
 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
 'name'=>'My Web Application',
        'theme'=>'[yii-bootstrap-starter-theme]',

Finally we need to setup up this config in views i.e. protected/views/layouts/main.php

<?php
        $bootstrapVersion = "3.0.0";
        $fontAwesomeVersion = "3.2.1";
        $jqueryVersion = "2.0.3";
        $queryUiVersion = "1.10.3";
?>


Reference: https://github.com/amnah/yii-bootstrap-starter-theme

Useful links:

  1.  XAMPP : https://www.apachefriends.org/download.html
  2.  WAMPP : http://www.wampserver.com/en/#download-wrapper
  3.  Yii Framework : http://www.yiiframework.com/download/


Friday, March 31, 2017

Getting started with GAE - Python on codenvy.io - Part 2

Continuing my earlier post here...


We had reached to a default application being created by codenvy as template to get started.
I will try to shade some light on this default application also share a backup of the source code for JUST IN CASE situations here.

Attached source code


Your workspace allows you to have multiple projects in it; we here are now looking at a sample that covers basics of app engine in one example.

During my learning curve all this application has was divided into seven steps now world being fast I believe this one shall suffice.

Running the application:
Your application is already coded ready to run with codenvy just click on source folder and press play you application shall start. There will be url at bottom shown in logs click on it to view your output.

DASHBOARD VIEW
 OUTPUT AFTER CLICKING ON LINK

List of concepts to look for to understand about source code:
  • Checkout app.yaml
    This file gives you entire configuration of your app including directory structure and URL mapping
  • Open and study guestbook.py
    This is your core logic study it thoroughly like an OOP case study (bottom up). All routing and business logic is mentioned. Study libraries needed to include
  • Concepts covered
    URL Pattern to Class mapping
    Handling requests
    Classes / Libraries in order for reference : Jinja, webapp2, ndb, and Users
  • Google plus social sign in and verification

Thursday, March 30, 2017

Getting started with GAE - Python on codenvy.io - Part 1

Recently I was helping a  fellow developer to get started with online IDE so that I can share my experience of developing with wonderful Google Cloud Eco System. As usual offline setups were complicated for entry level developer to get started so I decided to turn on to my till then favorite c9.io.

Now here's the problem, when will you corporates understand the epidemy of a student or starter level devloper looking for learning. C9.io has now made credit card verification mandatory for new users.

So here I am going forward with my then second now first favorite cloud IDE codenvy.io...


Steps to get started are now shared below.





  1. Sign in using github
  2. Enter details
  3. Dashboard looks like this
  4. Next find your GAE python option in the same page by scrolling
  5. Next enter your project / workspace details to get started
  6. And now you see your workspace starting up for first time with a simple project; which looks like this
  7. Now everything is setup and ready to roll: see you in follow up post

Quick setup Phonegap Development Environment using Docker

INTRO NOTE : Pre-requisite is to have ubuntu 16.04 Following DIGITAL OCEAN tutorial for same...