Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fabricebrito's full-sized avatar

Fabrice Brito fabricebrito

View GitHub Profile
@fabricebrito
fabricebrito / ui.R
Created April 27, 2014 18:53
reproducible report
library(shiny)
library(knitr)
# Define UI for application
shinyUI(fluidPage(
## Application title
titlePanel("Dynamic report"),
fluidRow(
@fabricebrito
fabricebrito / example1.geojson
Created May 30, 2014 10:08
Rdclite4g example 1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fabricebrito
fabricebrito / nomad.R
Last active August 29, 2015 14:08
Tidy NASA NOMAD and query it
strs <- readLines("~/Downloads/nomad_seabass_v2.a_2008200.txt")
nomad <- read.csv(text=strs, skip=92, header=FALSE, stringsAsFactors = FALSE)
nomad.names <- "year,month,day,hour,minute,second,lat,lon,id,oisst,etopo2,chl,chl_a,kd405,kd411,kd443,kd455,kd465,kd489,kd510,kd520,kd530,kd550,kd555,kd560,kd565,kd570,kd590,kd619,kd625,kd665,kd670,kd683,lw405,lw411,lw443,lw455,lw465,lw489,lw510,lw520,lw530,lw550,lw555,lw560,lw565,lw570,lw590,lw619,lw625,lw665,lw670,lw683,es405,es411,es443,es455,es465,es489,es510,es520,es530,es550,es555,es560,es565,es570,es590,es619,es625,es665,es670,es683,ap405,ap411,ap443,ap455,ap465,ap489,ap510,ap520,ap530,ap550,ap555,ap560,ap565,ap570,ap590,ap619,ap625,ap665,ap670,ap683,ad405,ad411,ad443,ad455,ad465,ad489,ad510,ad520,ad530,ad550,ad555,ad560,ad565,ad570,ad590,ad619,ad625,ad665,ad670,ad683,ag405,ag411,ag443,ag455,ag465,ag489,ag510,ag520,ag530,ag550,ag555,ag560,ag565,ag570,ag590,ag619,ag625,ag665,ag670,ag683,a405,a411,a443,a455,a465,a489,a510,a520,a530,a550,a555,a560,a565,a570,a590,a6
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs

Copy nbflatten.py to somewhere on $PATH. Then, in the root of a git repository, run these commands:

echo "*.ipynb diff=ipynb" >> .gitattributes 
git config diff.ipynb.textconv nbflatten.py

When you change a notebook and run git diff, you'll see the diff of flattened, simplified notebooks, rather than the full JSON. This does lose some information (metadata, non-text output), but it makes it easier to see simple changes in the notebook.

This doesn't help with merging conflicting changes in notebooks. For that, see nbdiff.org.

"""This script will look for all .ipynb files in source_dir and convert them on the same place to
.rst files.
It is used in order to integrate notebooks output to sphinx documentation.
Read it, use it, hack it and share it ! Or you can do better writing a sphinx extension :-)
:Url:
https://gist.github.com/hadim/16e29b5848672e2e497c
:Author:
@fabricebrito
fabricebrito / grade01.py
Created December 1, 2014 09:56
Per my friend Simone
print("test_program01_0 ok -> 5 points\ntest_program01_1 ok -> 5 points\ntest_program01_2 ok -> 5 points\nTotal score: 15.0")
@fabricebrito
fabricebrito / index.html
Created December 16, 2014 11:50
TEP-QuickWin tree
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<style>
circle.dataset {
fill: white;
}
circle.ifg {
fill: red;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.