Skip to content

Instantly share code, notes, and snippets.

function getYahooPrice(symbol, datetime) {
symbol = symbol || "NSE:PANACEABIO";
// symbol = symbol.replace("NSE:", "") + ".NS";
Utilities.sleep(Math.floor(Math.random() * 5000))
var url = 'https://query1.finance.yahoo.com/v7/finance/download/'+ symbol + '?interval=1d&events=history'; // last one day history
Logger.log(url);
var response = UrlFetchApp.fetch(url, {muteHttpExceptions: true});
if (response.getResponseCode()) {
var textFile = response.getContentText();
if (textFile.indexOf("Date") != -1) {
apt-get clean && apt-get update && apt-get install -y \
locales \
language-pack-fi \
language-pack-en && \
export LANGUAGE=en_US.UTF-8 && \
export LANG=en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
locale-gen en_US.UTF-8 && \
dpkg-reconfigure locales
"""
## Example Airflow Workflow (DAG)
Markdown docstrings are rendered in the Airflow UI!!!
"""
from airflow import DAG
from airflow.models import BaseOperator
from datetime import datetime, timedelta
@kannaiah
kannaiah / configure_muliple_gcc.sh
Created April 9, 2019 17:24 — forked from SunnyRaj/configure_muliple_gcc.sh
Configure multiple GCC versions on ubuntu
#!/usr/bin/env bash
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
sudo apt-get install -y gcc-4.8 g++-4.8 gcc-4.9 g++-4.9 gcc-5 g++-5 gcc-6 g++-6 gcc-7 g++-7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
@kannaiah
kannaiah / bash-cheatsheet.sh
Created March 26, 2019 17:16 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
%matplotlib inline
import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches
width = 9
height = 3
def next_greater_power_of_2(x):
return 2**(x-1).bit_length()