Skip to content

Instantly share code, notes, and snippets.


Arfon Smith arfon

View GitHub Profile
arfon /
Last active May 2, 2021
BigQuery Examples for blog post

How many times shouldn't it happen...


SELECT count(*)
FROM (SELECT id, repo_name, path
        FROM [bigquery-public-data:github_repos.sample_files]
      ) AS F
View goofys.bash
# Install go
$ sudo apt-get install golang-go
# Download goofys package
$ go get
# Install goofys
$ go install
# Copy the goofys binary to somewhere in your path
arfon /
Last active Nov 2, 2020
GitHub Archive event formats


arfon / repo-cleanup.rb
Created May 17, 2020
GitHub repo cleanup
View repo-cleanup.rb
require 'octokit'
GH_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxx"
GITHUB = => true, :access_token => GH_TOKEN)
repositories = GITHUB.repositories('arfon')
puts "Working with #{repositories.size} repositories"
repositories.each do |r|
arfon / LICENSE
Last active Apr 16, 2020
How to make TESS FITS cubes using Astrocut and MAST
BSD 3-Clause License
Copyright (C) 2010-2018 Association of Universities for Research in Astronomy (AURA)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
arfon / generate
Last active Feb 20, 2020
Let's try and generate some codemeta files.
View generate
# For an OO language, this is distinctly procedural. Should probably fix that.
require 'json'
details ={})
capture_params = [
{ :name => "title", :message => "Enter project name." },
{ :name => "url", :message => "Enter the URL of the project repository." },
arfon / example-joss.yaml
Created Feb 5, 2020
Example JOSS metadata
View example-joss.yaml
# Complete worked example here:
title: 'Gala: A Python package for galactic dynamics'
- Python
- astronomy
- dynamics
- galactic dynamics
- milky way
View octostats.rb
require 'octokit'
require 'csv'
require 'hashie'
require 'active_support/all'
class PR < Hashie::Dash
property :pr
property :created_at
property :comment_count
property :commit_count
arfon /
Last active Jul 26, 2019
Query TESS data at MAST
# This script queries MAST for TESS FFI data for a single sector/camera/chip
# combination and downloads the data from the AWS public dataset rather than
# from MAST servers.
# Working with
# Make sure you're running the latest version of Astroquery:
# pip install
from astroquery.mast import Observations
import boto3