Skip to content

Instantly share code, notes, and snippets.

View gabraganca's full-sized avatar
🚀
going above and beyond

Gustavo Bragança gabraganca

🚀
going above and beyond
View GitHub Profile
@gabraganca
gabraganca / bootstrap_cmdline.py
Created May 8, 2018 15:11 — forked from elmotec/bootstrap_cmdline.py
Minimal python program with logging and argparse.
#!/usr/bin/env python
# encoding: utf-8
"""Minimal python commad line."""
import sys
import argparse
import logging
"""
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
Modified from remove_output by Minrk
"""
import sys
import io
import os
import argparse
from IPython.nbformat.current import read, write
/**write your css in here**/
/* like */
<style>
.CodeMirror{
font-family: "Consolas", sans-serif;
}
pre, code, kbd, samp {
font-family: Consolas, monospace;
#!/usr/bin/env python
"""
Script for running and save notebooks from command line.
How to use: `ipynb_run_save.py foo.ipynb
Some tweaks over ipydoctest.py from minrk
by @damianavila
"""
def append(xs, yss):
return [[x] + ys for x in xs for ys in yss]
def make_lists(*xss):
if len(xss) == 1:
return [[x] for x in xss[0]]
h, t = xss[0], xss[1:]
return append(h, make_lists(*t))
To get Git to diff between your odt/odp/ods files you will need to do the following things:
Install a conversion tool
$ sudo yum install odt2txt
Create your git config info directory if it's not already there
$ mkdir -p ~/.config/git/info
Add in attributes (you can paste this straight in or edit the file accordingly)
$ cat > ~/.config/git/info/attributes <<DELIM