Skip to content

Instantly share code, notes, and snippets.

View ricardobarroslourenco's full-sized avatar

Ricardo Barros Lourenço ricardobarroslourenco

View GitHub Profile
@whitead
whitead / self_cite.py
Last active December 1, 2024 11:16
Compute number of self citations with Semantic Scholar
# License CC0
import httpx
async def analyze_self_citations(doi):
async with httpx.AsyncClient() as client:
response = await client.get(
f"https://api.semanticscholar.org/graph/v1/paper/DOI:{doi}",
params={"fields": "title,authors,references.authors"}
)
@aaronspring
aaronspring / vectorized_sklearn_xr.ipynb
Last active April 27, 2024 19:05
vectorized `sklearn` with `xarray`
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonjack
jonjack / add-update-refresh-github-access-token-on-mac.md
Last active January 15, 2026 23:19
Adding & Updating GitHub Access Token on Mac

Using an Access Token for the first time

Follow the instructions on Github to Create an Access Token in Github

Configure Git to use the osxkeychain

By default, git credentials are not cached so you need to tell Git if you want to avoid having to provide them each time Github requires you to authenticate. On Mac, Git comes with an “osxkeychain” mode, which caches credentials in the secure keychain that’s attached to your system account.

You can tell Git you want to store credentials in the osxkeychain by running the following:-

@brentjanderson
brentjanderson / Howto.md
Created February 20, 2018 17:55
SSH Tunneling with Firefox

Sometimes it is useful to route traffic through a different machine for testing or development. At work, we have a VPN to a remote facility that we haven't bothered to fix for routing, so the only way to access a certain machine over that VPN is via an SSH tunnel to a machine that is reachable over the VPN. Other times, I have used this technique to test internet-facing requests against sites I am developing. It is pretty easy, and if you don't use firefox regularly, you can treat Firefox as your "Proxy" browser and other browsers can use a normal configuration (Although you can also configure an entire system to use the proxy, other articles exists that discuss this potential).

  1. Open a terminal
@dncgst
dncgst / rgdal_install.md
Last active October 21, 2024 20:08
How to install the rgdal R package

How to install the rgdal R package

> install.packages("rgdal")

  • installing source package ‘rgdal’ ... configure: error: gdal-config not found or not executable.

The packages libgdal-dev and libproj-dev are required:

sudo apt-get install gdal-bin proj-bin libgdal-dev libproj-dev

@qvil
qvil / license-badges.md
Created August 2, 2017 07:14 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • Badges are made with Shields.io.
  • This badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.  
  • 🇫🇷 Cette liste en français
@gauravbarthwal
gauravbarthwal / Multi-Part zip extraction in Ubuntu.txt
Last active December 11, 2025 16:09
How to extract multi-part .zip, .z01, .z02 files in ubuntu
Download/Copy all related *.zip files in one directory.
Open terminal and change to that directory which has all zip files.
Enter command zip -s- FILE_NAME.zip -O COMBINED_FILE.zip
Enter unzip COMBINED_FILE.zip
@soply
soply / disp_multiple_images.py
Last active November 22, 2024 04:48
Plot multiple images with matplotlib in a single figure. Titles can be given optionally as second argument.
import matplotlib.pyplot as plt
import numpy as np
def show_images(images, cols = 1, titles = None):
"""Display a list of images in a single figure with matplotlib.
Parameters
---------
images: List of np.arrays compatible with plt.imshow.
@hbristow
hbristow / color.py
Created April 5, 2015 22:49
Color Brewer (http://colorbrewer.org) colormaps for Matplotlib
"""Perceptually improved colormaps
This module contains a number of colormaps and color space manipulation
functions that aid the visualization of data in Matplotlib. The colormaps
are taken from palettes at colorbrewer.org.
Sequential, diverging and qualitative (categorical) colormaps are provided.
They are, respectively:
- blue, green, purple, orange, pink, rose, ocean, winter, earth, fire
@rain1024
rain1024 / tut.md
Last active December 4, 2025 00:24
Install pdflatex ubuntu

PdfLatex is a tool that converts Latex sources into PDF. This is specifically very important for researchers, as they use it to publish their findings. It could be installed very easily using Linux terminal, though this seems an annoying task on Windows. Installation commands are given below.

  • Install the TexLive base
sudo apt-get install texlive-latex-base
  • Also install the recommended and extra fonts to avoid running into the error [1], when trying to use pdflatex on latex files with more fonts.