Skip to content

Instantly share code, notes, and snippets.

View servadestroya's full-sized avatar

servadestroya

View GitHub Profile
@servadestroya
servadestroya / jupyter_tools.sh
Created September 13, 2020 18:28
Functions to set attributes of a jupyter notebooks
#!/usr/bin/env bash
ipynb_set_authors () {
local authors="[]"
local file="$1"
for author in "${@:2}"; do
authors="$(jq --arg author "$author" '. + [{"name": $author}]' <(echo "$authors"))" || return $?
done
jq_edit "$file" --argjson authors "$authors" '.metadata.authors = $authors'
}
#include <iostream>
// Ejemplo de contador binario usando listas enlazadas
template<typename T>
struct Node {
Node<T>* next;
T data;
Node(T data, Node<T>* next=nullptr): data(data), next(next) {}
};