Thursday, September 1, 2016

Layout / Grid system in Bootstrap

Bootstrap divides page as mainly usable and not used part by mentioning class name as container for div tag.All the content we need to show is inside this div tag


This container is then divided into 12 equal parts indicating a block of layout. Basic concept of layout is a tabular structure. But tables have drawbacks in layout as we cannot overlap table on each other and it is very strict with columnar and row-wise structure.


Here bootstrap we use this 12 parts scheme to layout our visual components in a div with class name row
and each unit we show has class name starting with col-[+]-[*]
Note:
[+] here indicates values as lg(large screen), md(lappy/desktop), sm(tablet), xs(mobile)
[*] here indicates value from 1 to 12


One thing to understand here is that the value you set for one component should be either 12 or components in row(div) should addup to 12


Lets say layout we wish is two column for desktop display the code will look like


1
2
3
4
<div class="row">
  <div class="col-md-8"></div>
  <div class="col-md-4"></div>
</div>


This will divide page to give output somewhat like in image below:


Getting started with bootstrap [setting up]

CDN URL
CSS: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
JS   : https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js

index.html source code


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hello World Example</title>
    <link href="[css cdn url/relative path]" rel="stylesheet">
    <script src="[js cdn url/relative path]"></script>
</head>
    <body>
        <h1>Hello, world!</h1>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    </body>Example
</html>

Ńote:
On line no. 8 and 9 you can replace the CDN url mentioned above or download files and set relative path to source code.

Git go to any moment (commit) in time

Get this straight you are accessing repo thats already setup and has commits branches etc in it


Here's how you go to any period of commit in a repo status
Git repo url :  https://github.com/thatsmekaustubh/appengine.git
You start by cloning it in your working directory

git clone https://github.com/thatsmekaustubh/appengine.git 004appengine


To know all commits you can find it using this command

git log


To know all branches you can find it using this command

git show-branch -a


This shall give a picture of all flows of development
this in present moment of time is

start__masterBranch
      |__experimentsBranch

Commits were

  • false commit (hello world example)
  • Hello world example with commmand to run
  • Users API example 
The command shows
git log
all commit id's
You can switch between branches as
git checkout <branchname>

And go to particular commit by saying 

git checkout <commitid>

Github getting started

Account Part:
Signup to github and then login
once logged in you will see my repo in which you should click on Create New Repository
    Fill in details and say create
On the machine you wish to code and submit changes to github you need a SSH key setup on both peers (mentioned in another tutorial)


Coding Part:
Say,
git init 
on your code whereever it is

Code your files (Note: that you are on master right now) [detailed post on branching and merging]

To add all changes say
git add --all
(this stages all non-committed files)

To commit say,
git commit -m 'Your message for the commit'


Syncing part:
You might want to sync this changes to github website so,
Type this 
git remote add origin https://github.com/<username>/<reponame>.git


To send commit to server type
git push --all


This shall get your code on git hub open repository to be shared with all

Thursday, August 25, 2016

Hello world | Google App Engine | Python | Cloud9IDE (EDIT REQ)



Create following files in a directory by name helloWorld
           this setup is public on c9.io; to see click here
main.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
import webapp2


class MainPage(webapp2.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write('Hello, World!')

app = webapp2.WSGIApplication([
    ('/', MainPage),
], debug=True)


main_test.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import webtest

import main


def test_get():
    app = webtest.TestApp(main.app)

    response = app.get('/')

    assert response.status_int == 200
    assert response.body == 'Hello, World!'


app.yaml
1
2
3
4
5
6
7
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: main.app


Run your project as follows :
python googleAppEngineSDK/google_appengine/dev_appserver.py --host $IP --port 8081 --admin_host $IP --admin_port 8082 projects/helloWorld

Setting up c9.io (ubuntu) with Google App Engine SDK - PYTHON

I try to cover as much of steps required as possible in my posts but dont include them all in one post so that one doesnt get bombarded with information. Please refere to pre-requisite section with reference sufficient for you; if it doesnt exist please mention so in comment.


Pre-requisite :
c9.io account
Create a workspace with Python Config

STEPS:
Go to shell copy paste one at a time
STEP(1) Get SDK from Google to you c9.io workspace
wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.40.zip
STEP(2) Unzip the sdk package
unzip google_appengine_1.9.40.zip
STEP(3) Set path variable for future reference
export PATH=$PATH:/home/ubuntu/workspace/googleAppEngineSDK/google_appengine/


Reference : Google Docs

Creating Sheet using Google Drive Excel (Shared Manner)

Step 1 Go to drive.google.com
You need to login using your google account (xyz@gmail.com/ xyz@company.com)
Step 2 Click on new and select sheets
Step 3 Set any name at top where it says Untitled sheet and press save
Step 4 Next click on share to share it with any email id.
Note: In case you are using company email id you can only share the document with other emails within company domain ex. xyz@company.com can share it with someone like abc@company.com and not abc@gmail.com (mostly.. exceptions can be added by company google account admin)
Share can be done in one of three manner :
  1. readonly : where in other user can only read the document contents
  2. comment : where in other user can read and comment on the document contents
  3. edit : where in other user can read, commment edit the document contents
There can be one more option for sharing sheet publicly with one of the above three manner. Which means any one with link can perform that specified operations. To do so you simply need to copy and message URL to your contact

Monday, August 17, 2015

Review Lenovo Note K3

Hey there folks, its been a week now for me using my new mobile Lenovo Note K3 and here is my feedback about it as a regular IT guy.

This phablet pretty much sums it all, you get a descent screen size and great computing power to do your daily tasks. Especially for guies like me there is a gud news you can comfortably code, read, watch videos and play games. Lenovo has taken a gud effort designing this phone keeping it sleek and yet functional not to forget at a reasonable price.

Heating problem? You must be a die hard gamer to face this issue. So far I barely experienced any heating issue, but when I did it was in top center on back of device (when I was not using any case)

Full HD is a real delight! I am enjoying watching my favorite videos on this device. Sound quality is pretty gud and obviously if you need to rock your house with sound you need a speaker it isn't the fault of device manufacturers that they haven't housed a home entertainment system in your mobile. I have enjoyed songs in room full of 15 people partying, on local station, on the road and other crowded places full of noise and quality is satisfactorily audible in adverse situations.

Camera on both front and rear are delight, we took a selfie in theatre which explains it all.

Functionalities
As a developer: Yes I am coding with this device, not just coding I am building  websites, and apps with this device. So you get the idea college students and lite coders.
As a commuter: Except for Virar Locals from Mumbai I can call this phablet as a handy device, to check schedules, read feeds, books, papers play games. Your hands wont get tired that easily.
As a reader: I haven't finished any book yet but have read a couple of journal papers on this device and it was comfortable.
As a Mobile User: I know its crazy but I am getting better cell reception at all places, this was unexpected from any smartphone as I always had to search and re search and choose network 4 times a day!

Bottom line: If you are any one else then a die hard gamer or a graphic designer (who draw - which needs stylus) or a person spending most of the time on voice calls this is a phablet/ smartphone for you; and trust me it cant go any better at this pricing.

Friday, May 1, 2015

Is there an app for that?

This is my first post in the series is there an app for that series of post !

What got me thinking is I know lot of technology stuff I use a latest android tablet compatible with pretty much every single app available there (obviously not all apps) and I face many odd needs with this tablet I use.

So I have decide to write a review of app that I use or come across and define its application.

Cheers to a new beginning!

Friday, April 17, 2015

Asus Fonepad 7- Coding machine: Apps installation

Programming on Android Tablet


As in post share here I plan to upgrade the use of this gadget for full fledged coding....

Apps tested:

AIDE apps:

https://play.google.com/store/apps/details?id=com.aide.ui
https://play.google.com/store/apps/details?id=com.aide.web

AWD app:

https://play.google.com/store/apps/details?id=org.kidinov.awd

Cpp Droid:

https://play.google.com/store/apps/details?id=name.antonsmirnov.android.cppdroid

QPython:

https://play.google.com/store/apps/details?id=com.hipipal.qpyplus

I have installed this apps prior to this but haven't got into fully utilizing them...
The plan this time is to test them to fully utilizing them for coding.

My Asus Fonepad 7 ME 175CG

My tablet and day to day companion
Official page: http://www.asus.com/in/Tablets_Mobile/ASUS_Fonepad_7_Dual_SIM_ME175CG/
Note: Mine is single sim
GSM arena: http://www.gsmarena.com/asus_fonepad_7-5674.php


Quick setup Phonegap Development Environment using Docker

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