This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime as dt | |
import json | |
import logging | |
import os | |
from typing import Dict, Tuple | |
import requests | |
BASE_API = "https://reports.api.clockify.me/v1" | |
PREP_PROJECT_ID = "<can-enter-it-here>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bs4 | |
import requests | |
import pandas as pd | |
list_of_ib_urls = [ | |
"https://www.interviewbit.com/courses/programming/topics/arrays/", | |
"https://www.interviewbit.com/courses/programming/topics/math/", | |
"https://www.interviewbit.com/courses/programming/topics/binary-search/", | |
"https://www.interviewbit.com/courses/programming/topics/strings/", | |
"https://www.interviewbit.com/courses/programming/topics/bit-manipulation/", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//A very simple example of an interface in golang | |
package main | |
import "fmt" | |
type apple struct { | |
calories int | |
} | |
type orange struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: remote-config-deployer | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: 2010-09-09 | |
Description: Template to create an EC2 instance and enable SSH | |
Parameters: | |
KeyName: | |
Description: Name of SSH KeyPair | |
Type: 'AWS::EC2::KeyPair::KeyName' | |
ConstraintDescription: Provide the name of an existing SSH key pair |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:12.04 | |
# Install dependencies | |
RUN apt-get update -y | |
RUN apt-get install -y apache2 | |
# Install apache and write hello world message | |
RUN echo "Hello Cloud Gurus!!!! This web page is running in a Docker container!" > /var/www/index.html | |
# Configure apache | |
RUN a2enmod rewrite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.0 | |
os: linux | |
files: | |
- source: /index.html | |
destination: /var/www/html/ | |
hooks: | |
BeforeInstall: | |
- location: scripts/install_dependencies.sh | |
timeout: 300 | |
runas: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import datetime | |
import json | |
import logging | |
import os | |
from google.cloud import storage | |
from twitter_scraper import get_tweets | |
log = logging.getLogger() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using @property decorator | |
# Source - https://www.programiz.com/python-programming/property | |
class Celsius: | |
def __init__(self, temperature=0): | |
self.temperature = temperature | |
def to_fahrenheit(self): | |
return (self.temperature * 1.8) + 32 | |
@property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def windowed_dataset(series, window_size, batch_size, shuffle_buffer): | |
"""Function for creating a windowed dataset for sequence training""" | |
dataset = tf.data.Dataset.from_tensor_slices(series) | |
dataset = dataset.window(window_size + 1, shift=1, drop_remainder=True) | |
dataset = dataset.flat_map(lambda window: window.batch(window_size + 1)) | |
dataset = dataset.shuffle(shuffle_buffer).map(lambda window: (window[:-1], window[-1])) | |
dataset = dataset.batch(batch_size).prefetch(1) | |
return dataset |
NewerOlder