Skip to content

Instantly share code, notes, and snippets.

@jordeu
jordeu / pandas overflow error.ipynb
Created December 17, 2014 09:06
Pandas groupby overflow error
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jordeu
jordeu / commentedfile.py
Created November 28, 2014 15:45
Class to read and write commented CSV files (pandas dataframe compatible)
class CommentedFile(io.TextIOWrapper):
def __init__(self, f, mode, values=None, comments=None, commentchar="#", writedate=True):
super().__init__(io.FileIO(f, mode))
self.values = values
self.comments = comments
self._commentchar = commentchar
if writedate:
@jordeu
jordeu / tvc
Last active August 29, 2015 13:57
Simple bash script to download "TV3 a la carta" videos
#!/bin/bash
echo
echo "##"
echo "## TVC downloader (v2.0)"
echo "## --------------------------------------"
echo "## author: Jordi Deu-Pons"
echo "## --------------------------------------"
echo "##"
echo
@jordeu
jordeu / gist:8931468
Created February 11, 2014 08:59
Intellij IDEA freeze X Windows on a breakpoint
When you stop at a breakpoint while a popup of your app is opened, then it might happen your whole X is frozen. To avoid this use this flag in your run/debug setting of your application (Run/Debug configuration, VM Options field):
-Dsun.awt.disablegrab=true
For more information about this Sun JDK bug please refer to the BUG #6714678
[ http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6714678 ].
@jordeu
jordeu / gist:8801618
Last active September 27, 2017 11:07
Simple script to enumerate the headers of a tsv file (it can be compress with gzip)
#!/bin/bash
if [ $1 ]
then
if [ ${1: -3} == ".gz" ]
then
CAT="zcat $1"
else
CAT="cat $1"
fi
@jordeu
jordeu / gist:5275092
Last active July 25, 2021 16:44
An example of Markdown with a TOC table working in bitbucket.
- [User guide](#markdown-header-user-guide)
- [Installation](#markdown-header-installation)
- [Installation and Execution](#markdown-header-installation-and-execution)
- [Download and install](#markdown-header-download-and-install)
- [Execution](#markdown-header-execution)
- [Advanced configuration](#markdown-header-advanced-configuration)
- [Update](#markdown-header-update)
- [Administration](#markdown-header-administration)
- [Access managment](#markdown-header-access-managment)
- [Customizing SVGMap](#markdown-header-customizing-svgmap)