Skip to content

Instantly share code, notes, and snippets.

View yannforget's full-sized avatar

Yann Forget yannforget

  • Bluesquare
  • Brussels
View GitHub Profile
import requests
params = {'access_token': '<your-access-token>'}
# Create the deposit resource
url = "https://sandbox.zenodo.org/api/deposit/depositions"
headers = {"Content-Type": "application/json"}
res = requests.post(
url,
@lebarde
lebarde / md2htmlyaml
Last active April 30, 2018 04:02
Convert Markdown to HTML and leave the YAML verbatim (to use in Hugo)
#!/bin/sh
# This script converts a .md Markdown file into a HTML file.
# It takes advantage of Pandoc for that, but keeps the front
# matter verbatim in order to process it into Hugo.
# tmp file:
TMP=`mktemp`
MAX0="$(cat /sys/class/power_supply/BAT0/charge_full)"
CAP0="$(cat /sys/class/power_supply/BAT0/charge_now)"
BAT="$(echo "100*(${CAP0})/(${MAX0})" | bc)"
echo $BAT%
@kaitmorano
kaitmorano / README.md
Created October 20, 2015 06:32 — forked from TDahlberg/README.md
GeoData Science Learning Resources

#“A data scientist is someone who knows more statistics than a computer scientist and more computer science than a statistician.” -Josh Blumenstock

#"A geo-data scientist is someone who knows more about GIS than either of those guys." -Tyler Dahlberg

#Going Geo Open Source In all likelihood a list like this has been written somewhere, by someone, for some reason. I know I'm not breaking any ground here; I'm just trying to organize on paper what's been going through my head ever since I got out of grad school.

@njwilson23
njwilson23 / landsat.py
Last active April 18, 2016 18:59
Tool for browsing landsat data in IPython
""" Tool for searching Landsat archives """
from urllib import request
from datetime import datetime
from xml.etree import ElementTree
from karta import Polygon
from karta.crs import LonLatWGS84
from IPython.display import Image, display
@jakevdp
jakevdp / discrete_cmap.py
Last active July 12, 2026 18:00
Small utility to create a discrete matplotlib colormap
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""
@ehamberg
ehamberg / markdown.vim
Created September 4, 2011 13:56
Vim: Syntax highlighting for in-line code in gitit markdown
" from http://vim.wikia.com/wiki/VimTip857
function! TextEnableCodeSnip(filetype, start, end, textSnipHl)
let ft=toupper(a:filetype)
let group='textGroup'.ft
if exists('b:current_syntax')
let s:current_syntax=b:current_syntax
" Remove current syntax definition, as some syntax files (e.g. cpp.vim)
" do nothing if b:current_syntax is defined.
unlet b:current_syntax
endif