Skip to content

Instantly share code, notes, and snippets.

View amitt001's full-sized avatar

Amit Tripathi amitt001

View GitHub Profile

Copy(resume) data from localhost to server:

rsync --partial --progress dump.tar.gz wkalt:wkdump

OOP and Design Pattern:

Association, Aggregation and Composition:

The distinction between aggregation and composition goes to old times for language like C++ where there is manual memory management. For languages with dynamic memory management everything is compositon.

Association: Multiple objects have their own life cycle and there is no owner. Ex teacher and student, independent life cycle.

@amitt001
amitt001 / Scala.rst
Last active May 19, 2016 12:57
Scala Notes

Functions

List Operations:

++ == extends

:+ == append

@amitt001
amitt001 / REST.rst
Last active April 27, 2016 17:02
REST API design principals

REST Design Important Points:

1. Use Nouns but no Verbs
Ex: /cars, /cars/23 ... Correct

/getCarData, /get/car/data ... wrong

  1. GET method & query parameter should not alter the state use PUT, POST and DELETE for changing the state
  2. Do not mix up singular and plural nouns use only plural nouns
@amitt001
amitt001 / subprocess
Created April 6, 2016 04:30
Python subprocess module details
Subprocess:
One class Popen and others are wrapper over it.
shell=True: This argument spawns a new intermediate process and run the command. If False, the command run in current process.
Popen: non blocking
subprcess call vs Popen:
call: is a wrapper over Popen and takes all the pamaters of popen. It is blocking and does not return until process has finished.
{"https://www.linkedin.com/recruiter/profile/2291218,Hkon,CAP": true, "https://www.linkedin.com/recruiter/profile/32583970,L0al,CAP": true, "https://www.linkedin.com/recruiter/profile/39316040,PljB,CAP": true, "https://www.linkedin.com/recruiter/profile/82771017,5uDZ,CAP": true, "https://www.linkedin.com/recruiter/profile/72503542,sLJm,CAP": true, "https://www.linkedin.com/recruiter/profile/92016330,j3jR,CAP": true, "https://www.linkedin.com/recruiter/profile/171554188,LLgJ,CAP": true, "https://www.linkedin.com/recruiter/profile/22262123,gJtD,CAP": true, "https://www.linkedin.com/recruiter/profile/192153896,e8oI,CAP": true, "https://www.linkedin.com/recruiter/profile/227383658,Ym3m,CAP": true, "https://www.linkedin.com/recruiter/profile/53537751,ewVD,CAP": true, "https://www.linkedin.com/recruiter/profile/21566375,DGEM,CAP": true, "https://www.linkedin.com/recruiter/profile/25650551,vdzk,CAP": true, "https://www.linkedin.com/recruiter/profile/96609874,0-3T,CAP": true, "https://www.linkedin.com/recruiter/profi
@amitt001
amitt001 / go.go
Created March 10, 2016 06:30
Go Notes
/*
STRING OPERATIONS
package strings
*/
exStr := "Hello World"
strings.Contains(exStr, "lo") //returns true/false
strings.Index(exStr, "lo") //returns 3
strings.Count(exStr, "o") //returns 2
strings.Replace(exStr, "l", "_", 3) //here first 3 l's is replaced with _
strings.Fields(exStr) //splits on space
{"size": null,
"topchart_rank": [1, 9, 1],
"reviewers": [28360326, 28393897, 28412320],
"istop_developer": true,
"app_update_date": {"$date": 1436918400000},
"screenshots": ["https://lh3.googleusercontent.com/MMue08byixTw74ST_VkNQDUUJBgVEbjNHDYLhIuHmYhMIMJIp3KjVlnhhqZQOZUtNt8=h310"],
"app_name": "WhatsApp Messenger",
"category": ["Communication"],
"ratings": [4.4, 4.4, 4.4, 4.4],
"min_osversion": "2.1 and up",
@amitt001
amitt001 / Details
Last active December 9, 2015 12:27
Sentiment Analysis Project Details
All the sentiment analysis data is present in the folder named "senti"
Directory structure:
senti
├── Trainingset_creator
│   ├── README.rst
│   ├── appsid
│   ├── reviews_crawler.py
│   └── settings.py
├── config.py
@amitt001
amitt001 / iterm2-solarized.md
Created November 11, 2015 10:44 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized