Skip to content

Instantly share code, notes, and snippets.

@mrchess
mrchess / gist:7678104
Created November 27, 2013 15:59
nl2br coffee plugin
$.extend
nl2br: (str, is_xhtml = false) ->
breakTag = (if (is_xhtml or typeof is_xhtml is "undefined") then "" else "<br>")
(str + "").replace /([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1" + breakTag + "$2"
My Time at Lehman
I started at Lehman Brothers on June 1st, 2007 as a first year analyst. It was my first job out of college. Dick Fuld, the CEO at the time, publicly discussed “the road to two-hundred,” in which he would not retire until the stock reached $200 per share, almost three times the price when I arrived. Everyone at the firm believed this as though it were a fact – that there was something special about Lehman Brothers stock – it always went up.
I joined Lehman for a few reasons. The first was personal. My mother worked on Wall Street and passed away when I was a teenager. I felt, somewhat misguidedly, as though following in her footsteps would bring me closer to her. The other reasons were simpler. I had been interested in the stock market as a kid (though I went to work trading bonds and credit derivatives), I wanted to make good money, and I thought maybe, just maybe, it would be a bit of fun.
Investment banking was a default career of sorts in 2007, something for the kids who didn’t quite k
@mrchess
mrchess / gist:5032262
Created February 25, 2013 18:56
URL parameter reader
###
A simple global function to help read URL parameters.
ex. www.google.com?value=1 -- URLY.get('value')
###
window.URLY =
get : (key) ->
key = key.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]")
regexS = "[\\?&]" + key + "=([^&#]*)"
regex = new RegExp(regexS)
results = regex.exec(window.location.href)

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

@mrchess
mrchess / box-shadow.html
Created November 13, 2012 17:09 — forked from ocean90/box-shadow.html
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;
@mrchess
mrchess / gist:1820380
Created February 13, 2012 20:57
Exposes a variable openHTTPs which keeps track of how many XMLHttpRequests you have active.
<script>
(function() {
var oldOpen = XMLHttpRequest.prototype.open;
window.openHTTPs = 0;
XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {
window.openHTTPs++;
this.addEventListener("readystatechange", function() {
if(this.readyState == 4) {
window.openHTTPs--;
}
@mrchess
mrchess / gist:1757758
Created February 7, 2012 06:46
copy of vm install sh - windows vm osx
#!/usr/bin/env bash
# Caution is a virtue
set -o nounset
set -o errtrace
set -o errexit
set -o pipefail
log() { printf "$*\n" ; return $? ; }