Skip to content

Instantly share code, notes, and snippets.

View Sanjogsharma's full-sized avatar
💭
I may be slow to respond.

Sanjogsharma

💭
I may be slow to respond.
View GitHub Profile
@Sanjogsharma
Sanjogsharma / terraform-lab.md
Last active February 10, 2019 18:04 — forked from ravsau/terraform-lab.md
Terraform lab

In this tutorial, I will use Terraform to deploy an EC2 Instance. Terraform is an infrastructure as code software tool created by Hashicorp. We will refer to Hashicorp's AWS documentation throughout this tutorial.

Find the code and steps for this Lab at my github page linked here.

What is Terraform?

Terraform can build, modify, and version infrastructure safely and efficiently. Terraform can manage existing and popular service providers like AWS, Azure, Google Cloud. It can also handle custom in-house solutions.

Terraform is similar to Cloudformation, but they have some significant differenes.

@Sanjogsharma
Sanjogsharma / Birthday_paradox
Last active September 9, 2015 23:11
Check if two people share the same birthday (python)
import random
random.seed()
def paradox_tester(num_people): #this fucntion tests if num_people share birthday
same_birthdays = 0
birthdays = []
for people in range(num_people):
birthdays.append(random.randint(0, 365))
birthdays.sort()
seen_birthdays = []
@Sanjogsharma
Sanjogsharma / word_count
Last active September 10, 2015 15:39
count occurance of words seperated by whitespace (python)
# count occurance of words seperated by whitespace
from collections import defaultdict
# remove punctuation parks
def removes_punc(string):
'''removes punctuations from string'''
punc = ['.', ',', '!']
new_string = ''
Bucket Quotes Views
Baseline 32 595
Variation 1 30 599
Variation 2 18 622
Variation 3 51 606
Variation 4 38 578
SELECT Name
FROM Salesperson
WHERE ID in (SELECT salesperson_id
FROM Orders
HAVING COUNT(Number) >= 2)
@Sanjogsharma
Sanjogsharma / HW with yelp data
Created July 6, 2015 22:08
HW with Yelp data
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.cross_validation import train_test_split
from sklearn import metrics
import statsmodels.formula.api as smf
from mpl_toolkits.mplot3d import axes3d
import pandas as pd
# visualization
import seaborn as sns
@Sanjogsharma
Sanjogsharma / hw_3
Created June 22, 2015 22:47
Hw_3_IMDB_DAATA
'''
Pandas Homework with IMDB data
'''
import pandas as pd
import matplotlib.pyplot as plt
'''
BASIC LEVEL
'''
movies = pd.read_table('imdb_1000.csv', sep = ',')
@Sanjogsharma
Sanjogsharma / gist:4d62027e6f609e90e2cc
Last active August 29, 2015 14:23
Homework For Class 3
'''
PART 1:
'''
import csv
from collections import defaultdict
chicken = list(csv.reader(open('chipotle.tsv', 'rb'), delimiter='\t'))
@Sanjogsharma
Sanjogsharma / hw_1
Created June 9, 2015 04:09
first_hw
1: each order_id is an order. Each order id has an order(min value of order is one)
there are 1834 orders
there are 4623 lines
chicken burrito is more popular, without counting the times where they were ordered twice