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
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) { |
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
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 |
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
""" | |
## 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 |
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
#!/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 |
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
#!/bin/bash | |
##################################################### | |
# Name: Bash CheatSheet for Mac OSX | |
# | |
# A little overlook of the Bash basics | |
# | |
# Usage: | |
# | |
# Author: J. Le Coupanec | |
# Date: 2014/11/04 |
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
%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() |