Skip to content

Instantly share code, notes, and snippets.

function OptionCost(symbol, date, strike, type) {
return ImportJSON("https://query2.finance.yahoo.com/v10/finance/quoteSummary/"+symbol+""+date+""+type+""+strike+"000?modules=price", "/quoteSummary/result/price/regularMarketPrice/fmt")[1] * 100
}
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
import robin_stocks as r
from datetime import datetime
import pandas as pd
import pprint
import webbrowser
import os
def currency_format(x):
return "${:.2f}".format(x)
@dhenry
dhenry / Cache.java
Last active August 29, 2015 14:18
RXJava cache mechanism using Subjects
import android.support.annotation.Nullable;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
import rx.Observable;
import rx.schedulers.Schedulers;
import rx.subjects.AsyncSubject;
/**
* An extension of {@link RelativeLayout}. Displays a series of overlapping items.
* Can be populated with data from a {@link android.widget.ListAdapter}.
*
* Based on: https://github.com/frankiesardo/LinearListView
*/
public class OverlapRelativeListView extends RelativeLayout {
private int overlapMargin;
private ListAdapter mAdapter;