Skip to content

Instantly share code, notes, and snippets.

View pllim's full-sized avatar
💭
Clickety clack clack. ⌨

P. L. Lim pllim

💭
Clickety clack clack. ⌨
View GitHub Profile
import requests
headers = {}
headers['Accept'] = 'application/vnd.github.mockingbird-preview'
url = 'https://api.github.com/repos/astropy/astropy/issues/2590/timeline'
r = requests.get(url, headers=headers)
r.json()
r = requests.get(url, headers=headers)
r.json()
history
import os
import netrc
from github import Github
from batchpr import Updater
DESCRIPTION = """
This is an automated update of the astropy-helpers submodule to {0}. This
from bs4 import BeautifulSoup
import urllib
import requests
S = requests.Session()
r = S.get('http://archive.noao.edu/search/query')
# not 100% sure this is necessary any mroe...
S.headers['X-CSRF-Token'] = BeautifulSoup(r.text, 'html5lib').find('meta',{'name':'csrf-token'}).attrs['content']
@saimn
saimn / pre-commit
Last active February 25, 2019 15:06
#!/bin/sh
#
# Git pre commit hook which find the next PR number and replace occurences of
# GUESSPR in the changelog
files_modified=`git diff --cached --name-only --diff-filter=ACM`
if [[ $files_modified == *"CHANGES.rst"* ]]; then
ghurl="https://api.github.com/repos/astropy/astropy/issues?state=all&sort=created&direction=desc&per_page=1"
echo "Fetching PR number from $ghurl"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@keflavich
keflavich / failure.md
Last active June 12, 2017 19:56
test timeout/failure

command: ~/anaconda/envs/astropy27/bin/python setup.py test --remote-data=astropy -a "--mpl"

========================================================================== test session starts ==========================================================================
platform darwin -- Python 2.7.11, pytest-3.0.7, py-1.4.33, pluggy-0.4.0

Running tests with Astropy version 2.0.dev18294.
Running tests in lib.macosx-10.5-x86_64-2.7/astropy docs.
@joyrexus
joyrexus / README.md
Last active December 30, 2024 01:37
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@barentsen
barentsen / plot-astropy-benchmarks-by-python-version.py
Created January 8, 2017 18:32
Compares the performance of AstroPy between different versions of Python (2.7 vs 3.x).
"""Compares the performance of AstroPy between different versions of Python (2.7 vs 3.x).
This script reads AstroPy's benchmarking output (cf. github.com/astropy/astropy-benchmarks.git)
as generated by the airspeed velocity benchmarking package (cf. asv.readthedocs.io).
It then compares & plots the median execution time for different Python versions.
This script was hacked together as part of the Hack Day at the 229th American Astronomical
Society (AAS) meeting held in Grapevine, Texas. (Twitter: #hackaas #aas229.)
The output of this script is shown in the following tweet: