Skip to content

Instantly share code, notes, and snippets.

Avatar

Arfon Smith arfon

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

How many times shouldn't it happen...

-- https://news.ycombinator.com/item?id=11396045

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 github.com/kahing/goofys
# Install goofys
$ go install github.com/kahing/goofys
# Copy the goofys binary to somewhere in your path
@arfon
arfon / create_events.md
Last active Nov 2, 2020
GitHub Archive event formats
View create_events.md

2011-02-15-0.json.gz

{  
   "repo":{  
      "id":1367057,
      "url":"https://api.github.dev/repos/motech/MOTECH",
      "name":"motech/MOTECH"
   },
   "type":"CreateEvent",
@arfon
arfon / repo-cleanup.rb
Created May 17, 2020
GitHub repo cleanup
View repo-cleanup.rb
require 'octokit'
GH_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxx"
GITHUB = Octokit::Client.new(:auto_paginate => true, :access_token => GH_TOKEN)
repositories = GITHUB.repositories('arfon')
puts "Working with #{repositories.size} repositories"
repositories.each do |r|
@arfon
arfon / LICENSE
Last active Apr 16, 2020
How to make TESS FITS cubes using Astrocut and MAST
View LICENSE
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
arfon / generate
Last active Feb 20, 2020
Let's try and generate some codemeta files.
View generate
#!/usr/bin/ruby
# For an OO language, this is distinctly procedural. Should probably fix that.
require 'json'
details = Hash.new({})
capture_params = [
{ :name => "title", :message => "Enter project name." },
{ :name => "url", :message => "Enter the URL of the project repository." },
@arfon
arfon / example-joss.yaml
Created Feb 5, 2020
Example JOSS metadata
View example-joss.yaml
# Complete worked example here: https://joss.readthedocs.io/en/latest/submitting.html#example-paper-and-bibliography
---
title: 'Gala: A Python package for galactic dynamics'
tags:
- 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
arfon / tess.astroquery.mast.py
Last active Jul 26, 2019
Query TESS data at MAST
View tess.astroquery.mast.py
# 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 http://astroquery.readthedocs.io/en/latest/mast/mast.html
# Make sure you're running the latest version of Astroquery:
# pip install https://github.com/astropy/astroquery/archive/master.zip
from astroquery.mast import Observations
import boto3