Skip to content

Instantly share code, notes, and snippets.

/**********************************************/
/*
/* IR_Dark_Monokai
/* Designed and developed by Andres Pagella (@mapagella)
/* http://www.andrespagella.com/customising-chrome-devtools
/*
/* Based on Ben Truyman's IR_Black
/* which is...
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
def build_portfolio
# preparing portfolio data for charts
stocks, eps, pm, industries, price_performance = [], [], [], {}, []
Portfolio.first.portfolio_companies.each do |pc|
# create arrays from data
stocks << pc.company.symbol if pc.company.symbol
eps << pc.company.diluted_eps if pc.company.diluted_eps
pm << (pc.company.profit_margin*100).round(1) if pc.company.profit_margin
var PortfolioBuilder = function() {
var $context = "";
var symbols = [];
var that = this;
return{
init: function(context) {
$context = $(context);
this.initSymbols();
this.updateButtons();
var res = ({
query:{
"count": 3,
"created": "2011-02-28T07:15:39Z",
"lang": "en-US",
"results": {
"rss": [{
"channel": {
"item": {
"title": "Post 1 Title",
### Getting entries from my blog (Posterous)
getBlogPosts = ->
req = $.ajax 'http://query.yahooapis.com/v1/public/yql',
jsonp:'callback'
dataType:'jsonp'
data:
q: "select channel.item.title, channel.item.pubDate,
channel.item.link from xml where
url = 'http://blog.jrmoran.com/rss' limit 6"
format: 'json'
/*
Excenlente,
unas observaciones.
*/
var items =
Array(
{ valor:"A", probabilidad: (5/10) },
{ valor:"B", probabilidad: (1/10) },
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
;; Jaime Moran 2011
(ns parser
(:use [clojure.contrib.duck-streams :only (read-lines)]
clojure.contrib.json))
;; This processes a CSV file, with all energy consumption data from
;; 1960-2009 accross all US states
;;
;; MSN,StateCode,Year,Data
@jrmoran
jrmoran / index.html
Created October 5, 2011 07:52 — forked from mbostock/.block
Axis Component
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.0.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.csv.js?2.0.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.js?2.0.0"></script>
<style type="text/css">
body {
font: 10px sans-serif;
@jrmoran
jrmoran / crimea.csv
Created October 5, 2011 07:53 — forked from mbostock/.block
Stacked Bar Chart
date wounds other disease
5/1854 0 95 105
6/1854 0 40 95
7/1854 0 140 520
8/1854 20 150 800
9/1854 220 230 740
10/1854 305 310 600
11/1854 480 290 820
12/1854 295 310 1100
1/1855 230 460 1440