Skip to content

Instantly share code, notes, and snippets.

@jwdinkel
jwdinkel / install.sh
Created June 14, 2019 07:40 — forked from rexlow/install.sh
Enable zsh in Gcloud shell
##
# This is an adoption from Oh My Zsh for Google Cloud Shell
# author - bobvanluijt
# source - https://github.com/bobvanluijt/google-cloud-shell-pro-zsh
##
main() {
# Install zsh
sudo apt-get -qq update
@jwdinkel
jwdinkel / javascript option stuff.js
Created November 19, 2017 21:17 — forked from aasmith/javascript option stuff.js
black scholes & IV in javascript
/* Returns probability of occuring below and above target price. */
function probability(price, target, days, volatility) {
var p = price;
var q = target;
var t = days / 365;
var v = volatility;
var vt = v*Math.sqrt(t);
var lnpq = Math.log(q/p);
function getBackgroundColor(rangeSpecification) {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
return sheet.getRange(rangeSpecification).getBackground();
}
function getForegroundColor(rangeSpecification) {
var sheet = SpreadsheetApp.getActiveSpreadsheet();
return sheet.getRange(rangeSpecification).getFontColor();
}