Skip to content

Instantly share code, notes, and snippets.

View tsycho's full-sized avatar

Asif tsycho

View GitHub Profile
@tsycho
tsycho / Tunes.js
Created September 8, 2011 02:11
BackboneTunes example
(function($) {
window.Album = Backbone.Model.extend({
isFirstTrack: function(index) {
return index == 0;
},
isLastTrack: function(index) {
return index >= this.get('tracks').length - 1;
},
@tsycho
tsycho / gist:1186928
Created September 1, 2011 18:51
Convert ccyymmdd string to Excel date
=DATE(LEFT(B2,4),MID(B2,5,2),RIGHT(B2,2))
@tsycho
tsycho / gist:1186360
Created September 1, 2011 15:06
Format all charts in FIMS style
Sub formatChartInFimsStyle()
Dim myChart As Chart
Set myChart = ActiveChart
' Set width and height
myChart.ChartArea.Height = 158
myChart.ChartArea.Width = 230
myChart.ChartArea.Format.Line.Visible = msoFalse
@tsycho
tsycho / extract-yields.rb
Created February 28, 2011 15:48
Extract non-agency yields from Credit Pricing Sheet
require 'win32ole'
require 'pathname'
require 'chronic'
excel = WIN32OLE.new('Excel.Application')
excel.visible = false
# Print header line
header = %w(Date Subprime_1yr Subprime_2yr Subprime_3yr Subprime_5yr Subprime_7+yr Prime_03-04_15yrPT Prime_03-04_30yrPT Prime_03-04_5/1PT Prime_03-04_10/1PT Prime_06-07_15yrPT Prime_06-07_30yrPT Prime_06-07_5/1PT Prime_06-07_10/1PT)
puts header.join(",").gsub("_", " ")