Skip to content

Instantly share code, notes, and snippets.

View ghacosta's full-sized avatar

Guille Acosta ghacosta

View GitHub Profile
@ghacosta
ghacosta / blackscholes.js
Created July 23, 2020 04:24 — forked from vorandrew/blackscholes.js
Black-Scholes in Javascript: A rewrite of http://www.espenhaug.com/black_scholes.html
/*
PutCallFlag: Either "put" or "call"
S: Stock Price
X: Strike Price
T: Time to expiration (in years)
r: Risk-free rate
v: Volatility
This is the same one found in http://www.espenhaug.com/black_scholes.html
but written with proper indentation and a === instead of == because it's
@ghacosta
ghacosta / urlobject.js
Created October 25, 2015 05:58 — forked from aymanfarhat/urlobject.js
JS utility function that: - Breaks down url to an object with accessible properties: protocol, parameters object, host, hash, etc... - Converts url parameters to key/value pairs - Convert parameter numeric values to their base types instead of strings - Store multiple values of a parameter in an array - Unescape parameter values
function urlObject(options) {
"use strict";
/*global window, document*/
var url_search_arr,
option_key,
i,
urlObj,
get_param,
key,
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
@ghacosta
ghacosta / StopWatch.php
Last active October 6, 2015 17:34 — forked from phybros/StopWatch.php
A simple "StopWatch" class to measure PHP execution time. The class can handle multiple separate timers at the same time.
<?php
class StopWatch {
/**
* @var $start float The start time of the StopWatch
*/
private static $startTimes = array();
/**
* Start the timer
*