Skip to content

Instantly share code, notes, and snippets.

View dmvianna's full-sized avatar

Daniel Vianna dmvianna

View GitHub Profile
@dmvianna
dmvianna / XLpandas.py
Last active December 10, 2015 21:48
Extending pandas DataFrame and Series objects [http://pandas.pydata.org/] so it properly saves multiple levels of column/row indexes and xlwt styles to .xls files.
"""
#ws argument is a xlwt worksheet object, as in:
from xlwt import Workbook
wb = Workbook()
ws = wb.add.sheet('sheet 1')
# Example of how to wrap xlwt.Style object
conv = pd.io.parsers.CellStyleConverter()
@dmvianna
dmvianna / test.py
Last active December 10, 2015 22:08
Testing XLpandas.py
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 10 15:14:02 2013
@author: daniel.vianna
"""
from copy import deepcopy
from xlwt import Worksheet
import numpy as np
@dmvianna
dmvianna / xlwt_colour_list.py
Created January 14, 2013 04:55
Code for generating colours list for use with xlwt. In XLS format, of course ;7)
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 14 15:36:36 2013
@author: daniel.vianna
"""
import xlwt as xlwt
import pandas as pd
conv = pd.io.parsers.CellStyleConverter()
@dmvianna
dmvianna / XLpandas2.py
Created January 23, 2013 06:08
Another iteration of XLpandas, now handling numpy.int64 gracefully (as xlwt cannot).
import pandas as pd
import xlwt as xlwt
import numpy as np
import xlwt.Style as Style
class XLtable(pd.DataFrame):
def __init__(self, df=None):
"""
pandas DataFrame with extra methods for setting location and xlwt style
in an Excel spreadsheet.
@dmvianna
dmvianna / test2.py
Last active December 11, 2015 12:39
Test file for XLpandas2.py
from XLstruc2 import XLtable, XLseries
from xlwt import Workbook, Worksheet, Style
from copy import deepcopy
conv = pd.io.parsers.CellStyleConverter()
hstyle_dict = {"font": {"bold": True},
"border": {"top": "thin",
"right": "thin",
"bottom": "thin",
"left": "thin"},
! Xft settings ---------------------------------------------------------------
Xft.dpi: 90 !96
Xft.antialias: true
Xft.rgba: none
Xft.hinting: true
Xft.hintstyle: hintslight
!Xft.autohint: true
@dmvianna
dmvianna / debnix.sh
Last active March 1, 2019 11:31
Shell script to install nix in a clean Debian instance -- and some Haskell dev tools
#!/bin/bash
#
# set up nix in a Debian instance
#
sudo apt-get update
sudo apt-get -y install bzip2 gcc libdigest-sha-perl libgmp-dev libncurses5-dev libz-dev make
curl https://nixos.org/nix/install | sh
@dmvianna
dmvianna / debJupyterHub.sh
Last active August 2, 2016 01:47
Installing the necessary tools to start a JupyterHub instance
#!/bin/bash
#
# set up JupyterHub in a Debian instance
#
sudo apt-get update
echo 'export TERM=xterm' >> $HOME/.profile
sudo apt-get -y install bzip2 gcc libdigest-sha-perl libgmp-dev make python3 python3-pip python3-venv npm nodejs-legacy libzmq3-dev
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx" : true,
"impliedStrict": true
},
"sourceType": "module"
},
@dmvianna
dmvianna / xmonad.hs
Last active December 20, 2017 21:11
~/.xmonad/xmonad.hs
import XMonad
main = xmonad $ def
{ terminal = "urxvt"
, normalBorderColor = "#cccccc"
, focusedBorderColor = "#cd8b00"
, modMask = mod3Mask -- depends on ~/.Xmodmap assigning Alt_R to mod3
}