Skip to content

Instantly share code, notes, and snippets.

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pandas_datareader import data as pdr
from datetime import datetime
import quandl
# Define the time range for data collection
start = datetime(2010, 1, 1)
end = datetime(2024, 1, 1)
@dbose
dbose / gist:22d0ae47e8d5ac7cf392c7237a99b424
Created April 7, 2021 11:42
DCA to BTC / ETH portfolio
const BTCMarkets = require('btc-markets')
const async = require('async')
const _ = require('lodash')
const schedule = require('node-schedule')
const winston = require('winston')
const os = require('os')
const log = winston.createLogger({
transports: [
new (winston.transports.File)({
@dbose
dbose / IPUMS-CPS-ETL
Created February 27, 2016 10:34
R processing script for US-CPS data as served by IPUMS
df$CLASSWKR_f <- factor(df$CLASSWKR,
levels=c(0,10,13,14,20,21,22,23,24,25,26,27,28,29,99),
labels=c("NIU",
"Self-employed",
"Self-employed, not incorporated",
"Self-employed, incorporated",
"Works for wages or salary",
"Wage/salary, private",
"Private, for profit",
"Private, nonprofit",
@dbose
dbose / SciPy on Snow Leopard
Last active January 4, 2016 13:29
Installation of scipy and numpy on Snow Leopard
# http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/#homebrew
brew install python
brew install gfortran
# Error: Library not loaded:
sudo ln -s /opt/X11/lib/libpng14.14.dylib /opt/local/lib/libpng14.14.dylib
sudo ln -s /opt/X11/lib/libfreetype.6.dylib /opt/local/lib/libfreetype.6.dylib
git clone https://github.com/numpy/numpy.git numpy
@dbose
dbose / hobo_field_exception
Created December 30, 2011 12:02
hobo_field exception
Debasish-Boses-MacBook-Pro:blog quantum19812001$ rails g hobo:migration
/Users/quantum19812001/Projects/ror-test/blog/vendor/plugins/hobo_fields/lib/hobo_fields/model.rb:95:in `belongs_to': undefined method `foreign_key' for #<ActiveRecord::Reflection::AssociationReflection:0x1023ea488> (NoMethodError)
from /Users/quantum19812001/Projects/ror-test/blog/app/models/order.rb:6
from /Users/quantum19812001/.rvm/gems/ruby-1.8.7-p352@ror-test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:454:in `load'
from /Users/quantum19812001/.rvm/gems/ruby-1.8.7-p352@ror-test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:454:in `load_file'
from /Users/quantum19812001/.rvm/gems/ruby-1.8.7-p352@ror-test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Users/quantum19812001/.rvm/gems/ruby-1.8.7-p352@ror-test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:453:in `load_file'
from /Users/quantum19812001/.rvm/gems/ruby-1.8.7-p352@ror-test/gems/act