Skip to content

Instantly share code, notes, and snippets.

View vedraiyani's full-sized avatar

Chintan Raiyani vedraiyani

  • SAP Labs
  • Bangalore, India
View GitHub Profile
import alpaca_trade_api as tradeapi
import time
import datetime
from datetime import timedelta
from pytz import timezone
tz = timezone('EST')
import numpy as np
import pandas as pd
@vedraiyani
vedraiyani / Google Colab SSH
Created July 17, 2020 11:16 — forked from yashkumaratri/Google Colab SSH
SSH into google colab
#CODE
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd
@vedraiyani
vedraiyani / slack_notifier.py
Created February 26, 2020 05:25 — forked from abhishekkrthakur/slack_notifier.py
Slack notification from python
import os
import requests
import json
SLACK_WEBHOOK= os.environ.get("SLACK_WEBHOOK")
def send_message(messages, channel="abhishek", username="beast"):
"""
:param messages: list of texts
def plot_eli5_top_explanations(
model: Model,
image: np.array,
class_names_mapping: Dict[int, str],
top_preds_count: int = 3,
fig_name: Optional[str] = None
) -> None:
image_columns = 3
image_rows = math.ceil(top_preds_count / image_columns)
@vedraiyani
vedraiyani / portainer.md
Created November 17, 2019 05:25 — forked from SeanSobey/portainer.md
Portainer Setup on Windows 10

Portainer on Windows 10

Here I have 2 methods for running portainer on windows, a quick, preferred method only requiring a fairly recent version of docker, or a more complicated method to try if that does not work.

Using docker.for.win.localhost

This setup will let you run Portainer on windows by using the docker.for.win.localhost endpoint.

Please note:

@vedraiyani
vedraiyani / nodejs-rfid.js
Created October 16, 2019 10:51 — forked from basham/nodejs-rfid.js
Use NodeJS to read RFID ids through the USB serial stream.
/*
DESCRIPTION
-----------
Use NodeJS to read RFID ids through the USB serial stream. Code derived from this forum:
http://groups.google.com/group/nodejs/browse_thread/thread/e2b071b6a70a6eb1/086ec7fcb5036699
CODE REPOSITORY
---------------
https://gist.github.com/806605
@vedraiyani
vedraiyani / GAN.py
Created September 23, 2019 10:25
A Simple GAN implementation with Keras and Tensorflow
from __future__ import print_function, division
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, Dropout
from keras.layers import BatchNormalization, Activation
from keras.layers.advanced_activations import LeakyReLU
from keras.models import Sequential, Model
from keras.optimizers import Adam
// actions/action_select_contact.js
function selectContact(contact) {
return {
type: 'CONTACT_SELECTED',
payload: contact
}
}
export default selectContact;
@vedraiyani
vedraiyani / 2to3_nb.py
Created September 25, 2018 08:43 — forked from takluyver/2to3_nb.py
Run 2to3 on IPython notebooks
#!/usr/bin/env python3
"""
To run: python3 nb2to3.py notebook-or-directory
"""
# Authors: Thomas Kluyver, Fernando Perez
# See: https://gist.github.com/takluyver/c8839593c615bb2f6e80
import argparse
import pathlib
from nbformat import read, write