start new:
tmux
start new with session name:
tmux new -s myname
/** | |
* 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 | |
*/ | |
function readRows() { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var rows = sheet.getDataRange(); | |
var numRows = rows.getNumRows(); |
App = new Marionette.Application(); | |
App.addRegions { | |
"headerRegion": "#header" | |
"topMenuRegion": "#top-menu" | |
"mainRegion" : "#main" | |
} | |
App.on 'initialize:after', -> | |
Backbone.history.start() |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" /> | |
<!-- when.js Promises implementation --> | |
<script src="https://raw.github.com/cujojs/when/master/when.js"></script> | |
<!-- Unit testing and mocking framework --> | |
<script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script> |
I was using Boot2Docker 1.2 (OSX) and wanted to use volume for MongoDB. First nothing was happening because 1.2 has no Guest Additions and volumes don't work. There is a workaround by making a boot2docker.iso from master which has Guest Additions.
But then Mongo didn't like putting data on VirtualBox's shared folders:
[initandlisten] WARNING: This file system is not supported. For further information see:
[initandlisten] http://dochub.mongodb.org/core/unsupported-filesystems
/* 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); |
/* | |
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 |
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
if [[ ${#} -ne 1 ]] | |
then | |
echo "Usage: ${0} upstart-conf-file" >&2 | |
exit 1 | |
fi |
#!/usr/bin/env python | |
"""Epic script to rename scary uppercase extensions (like .JPG) to | |
more friendly lowercase (like .jpg). | |
How to use | |
========== | |
Recursively rename all files in the current directory:: | |
fixext |