Skip to content

Instantly share code, notes, and snippets.

View nickynicolson's full-sized avatar

Nicky Nicolson nickynicolson

View GitHub Profile
@tschager
tschager / doi2bib.sh
Created July 10, 2017 08:18
DOI to BIBTEX using curl
curl -LH "Accept: application/x-bibtex" http://dx.doi.org/10.1186/s13015-017-0104-1
# -*- coding: utf-8 -*-
## EXPORTING TO PDF FROM revealjs OR jupyter notebook slides
## using nbconvert and decktape (https://github.com/astefanutti/decktape)
## to export pdf and/or html(revealjs)
## from jupyter notebook / revealjs html
## phantomjs must be included in path, and decktape directory must be place beside this export_reveal.py file
## for more detail, please check:
## nbconvert - https://github.com/jupyter/nbconvert
@peterdesmet
peterdesmet / geese-species-observations-per-year.png
Last active June 17, 2016 15:16
Species observations for a country per year (using GBIF occurrence facets)
geese-species-observations-per-year.png
@evanwill
evanwill / gitBash_windows.md
Last active April 26, 2024 03:58
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@dannguyen
dannguyen / bash-wikipedia-pageviews.md
Last active September 12, 2018 20:19
Bash function to read Wikipedia Pageviews API and pass it into Google Static Charts API to get 120-day time series of pageviews

An example in Bash of how to use Wikipedia's newly-announced Pageviews API and pass it into Google's hopefully-eternally-functioning Static Charts API. The result is a a quick time-series chart that visualizes 120 days of pageviews for any given Wikipedia page. Shout-out to the awesome jq command-line JSON tool.

The charts are crudely labeled...with a little more work you could turn it into a more interesting comparison chart (i.e. a grouped bar chart). But for now, here's what the last 120 days of page visits look like for Donald Trump and Hillary Clinton

(I've manually edite

@takluyver
takluyver / 2to3_nb.py
Last active November 5, 2021 02:45
Run 2to3 on IPython notebooks
#!/usr/bin/env python3
"""
To run: python3 nb2to3.py notebook-or-directory
"""
# Authors: Thomas Kluyver, Fernando Perez
# See: https://gist.github.com/takluyver/c8839593c615bb2f6e80
import argparse
import pathlib
from nbformat import read, write
@spond
spond / README.md
Last active November 22, 2023 09:52
phylotree.js "Hello World"

The simplest example of using phylotree.js

Create a phylotree.js object from a Newick tree string, and display it in an SVG element using default settings and styles. Because the default tree view supports clickable nodes, it is necessary to include jQuery and Bootstrap. It is always necessary to include d3, and phylotree.js script and styles (unless overridden by the user).

Click on internal nodes to bring up menus that allow you to collapse/select them.

@MoOx
MoOx / index.js
Last active February 9, 2024 22:44
Export/import github labels
// go on you labels pages
// eg https://github.com/cssnext/cssnext/labels
// paste this script in your console
// copy the output and now you can import it using https://github.com/popomore/github-labels !
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function(element) {
labels.push({
name: element.textContent.trim(),
= Scientific Bibliography
Pierre Ducrot <pierre.ducrot@gmail.com>
v1.0, 7-Mar-2015
:neo4j-version: 2.2.0
:author: Pierre Ducrot
:twitter: ducrot_pierre
:tags: science, publication
== Domain
@ClementC
ClementC / print_cm.py
Last active September 5, 2017 07:08 — forked from zachguo/print_cm.py
from sklearn.metrics import confusion_matrix
def print_cm(cm, labels):
"""pretty print for confusion matrixes"""
columnwidth = max([len(x) for x in labels])
# Print header
print(" " * columnwidth, end="\t")
for label in labels:
print("%{0}s".format(columnwidth) % label, end="\t")
print()