Skip to content

Instantly share code, notes, and snippets.

View dpshelio's full-sized avatar
🌴
On vacation

David Pérez-Suárez dpshelio

🌴
On vacation
View GitHub Profile
@dpshelio
dpshelio / analyse_grades.py
Last active June 23, 2022 18:42 — forked from ageorgou/analyse_grades.py
Plot the distribution of commit frequency for multiple submissions (WIP)
from pathlib import Path
import re
import tempfile
import shutil
import shlex
import subprocess
import warnings
import matplotlib.pyplot as plt
import pandas as pd
@dpshelio
dpshelio / swc_setup_gitconfig.sh
Created July 5, 2021 18:56
bash script to setup gitconfig
#!/bin/env bash
# Script to clean and recover git configs before teaching.
# Based on script example from
# https://dbwebb.se/kunskap/create-bash-script-with-options-commands-and-arguments
SCRIPT=$( basename "$0" )
VERSION="0.1"
BACKUP_PATTERN=".${USER}_gitconfig"
HOURS=6
@dpshelio
dpshelio / check_bug.py
Last active November 20, 2019 15:43
Problem for 7th class
import numpy as np
import subprocess
# Creates input file
data_input = np.zeros((20, 20))
data_input[-1, :] = 1
# The expeted result is all zeros, except the last one, it should be 1
expected = np.zeros(20)
expected[-1] = 1

Speaker Rider

by Tatiana Mac

Before I'll agree to a speaking event, I try to do as much research I can around the event to ensure it aligns with my ethos. I want to share this in case it's helpful to any other speakers.

👐 Speaking comes with immense privilege. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most marginalised and suppressed communities.

😫 I wish I didn't have to, but this is long because I provide a lot of explanations for those of you who never had to consider these things. And I will be honest, most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

1️⃣ All of these are based on my own ethos. I don't wish to or attempt to speak on behalf of all conference speake

@dpshelio
dpshelio / README.md
Last active April 22, 2018 20:59
Software taught on physics - Code and cleaned data used.

This gist includes some code using pandas to visualise the data from the results in the survey and the "cleaned" version of such dataset (partly done with OpenRefine - lost script - and some bits were done manually).

import matplotlib.pyplot as plt
import numpy as np
from itertools import product
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
cc = [[0, 0], [0, 0]]
ap = [[0.218, 0.196], [0.249, 0.056]] # astropy - palpy
ae = [[0.459, 0.458], [0.860, 0.231]] # astropy - pyephem
pe = [[0.563, 0.570], [1.012, 0.253]] # palpy - pyephem
data = {'astropy-astropy': cc,
@dpshelio
dpshelio / bring_conda.sh
Created October 24, 2017 15:41
bits I have in my bash/zshrc files
function conda_up () {
# This function (conda_up) will activate anaconda in your path - to deactivate run conda_down
CONDA_PATH=/opt/anaconda/bin
if [[ ":$PATH:" != *":$CONDA_PATH:"* ]]; then
PATH=$CONDA_PATH:$PATH;
fi
}
function conda_down () {
# Remove conda from the path
import numpy as np
import matplotlib.pyplot as plt
from astropy import units as u
from astropy.coordinates import SkyCoord
import sunpy.map
pixels = 300 * u.pix
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import datetime
import matplotlib.pyplot as plt
import sunpy.map
from sunpy.time import TimeRange
from sunpy.util import scraper
from astropy.utils.data import download_file
timerange = TimeRange(datetime.datetime.now() - datetime.timedelta(hours=5),