Skip to content

Instantly share code, notes, and snippets.

for(i in 1:7) mean(rnorm(N))
# Black-Scholes Option Value
# Call value is returned in values[1], put in values[2]
blackscholes <- function(S, X, rf, T, sigma) {
values <- c(2)
d1 <- (log(S/X)+(rf+sigma^2/2)*T)/sigma*sqrt(T)
d2 <- d1 - sigma * sqrt(T)
values[1] <- S*pnorm(d1) - X*exp(-rf*T)*pnorm(d2)
values[2] <- X*exp(-rf*T) * pnorm(-d2) - S*pnorm(-d1)
values
}
!!! 5
/[if lt IE 7] <html class="no-js ie6 oldie" lang="en">
/[if IE 7] <html class="no-js ie7 oldie" lang="en">
/[if IE 8] <html class="no-js ie8 oldie" lang="en">
<!--[if gt IE 8]><!-->
%html.no-js{ :lang => "en" }
<!--<![endif]-->
%head
= render :partial => "/layouts/additional_meta"
<<<<<<< HEAD
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..
@raphaelsaunier
raphaelsaunier / jquery.ngNav.js
Created May 17, 2013 13:12
Keyboard navigation for NextGEN Gallery
(function($){
$(document).on('keydown', function(e){
var code = e.keyCode || e.which;
if($.inArray(code, [37,39]) != -1)
document.location = $('.ngg-imagebrowser .'+(code==37?'back':'next')+' a').attr('href')+"#content";
});
})(jQuery);
body {background: #ccc;}
* {box-sizing:border-box;}
#container {width:300px;background:#eee;margin:0 auto}
.item {height:150px; width: 100px; background: white;
border:1px solid #ddd;line-height:50px;text-align:center;font-family:sans-serif;color:#ccc; font-size:20px;color:black;}
.item:after {color:gray;font-size:10px;}
.item.one-by-one:after {content:"1x1"}
.item.one-by-two {width:200px;}
.item.one-by-two:after {content:"1x2"}
.item.two-by-two {width:200px;height:300px;line-height:200px;}
@raphaelsaunier
raphaelsaunier / bootstrap-lite.scss
Last active August 29, 2015 14:07
Fat-free Bootstrap 3
// Core variables and mixins
@import "bootstrap/variables";
@import "bootstrap/mixins";
// Reset and dependencies
@import "bootstrap/normalize";
// Core CSS
@import "bootstrap/scaffolding";
@import "bootstrap/grid";
@raphaelsaunier
raphaelsaunier / curl.md
Last active August 29, 2015 14:13
developer.vimeo.com redirecting to vimeo.com

Valid response:

$ curl -I developer.vimeo.com
HTTP/1.1 200 OK
Date: Wed, 21 Jan 2015 11:35:43 GMT
Server: Apache
Expires: Tue, 20 Jan 2015 23:35:43 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
/*
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
'use strict';
@raphaelsaunier
raphaelsaunier / osx-for-hackers.sh
Last active August 27, 2015 12:05 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'