Skip to content

Instantly share code, notes, and snippets.

View amitt001's full-sized avatar

Amit Tripathi amitt001

View GitHub Profile
@amitt001
amitt001 / .vimrc
Created November 5, 2014 17:23
.Vimrc file
set nocompatible
set et
set ai
set sw=4
set ts=8
set si
set nu
set is
set ic
set sm
@amitt001
amitt001 / Inspirational Quotes
Created September 10, 2015 19:31
Inspiration Quotes by Jack Ma
You need the right people with you, not the best people.
No matter how tough the chase is, you should always have the dream you saw on the first day. It’ll keep you motivated and rescue you (from any weak thoughts).
We’re never in lack of money. We lack people with dreams, (people) who can die for those dreams.
@amitt001
amitt001 / Prime Factors
Created September 13, 2015 17:22
Prime Factors of a number with sieve of ertosthenes also check if a number is prime or not
#http://www.geeksforgeeks.org/print-all-prime-factors-of-a-given-number/
def prime_factors(n):
num = []
#add 2 to list or prime factors and remove all even numbers(like sieve of ertosthenes)
while(n%2 == 0):
num.append(2)
n /= 2
#divide by odd numbers and remove all of their multiples increment by 2 if no perfectlly devides add it
@amitt001
amitt001 / singleton.py
Last active October 22, 2015 13:03
Singleton class in Python
#http://elbenshira.com/blog/singleton-pattern-in-python/
#http://stackoverflow.com/questions/6760685/creating-a-singleton-in-python
def singleton(cls):
instances = {}
def getinstance():
if cls not in instances:
instances[cls] = cls()
return instances[cls]
return getinstance
@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

@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
{"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 / 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
{"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