Skip to content

Instantly share code, notes, and snippets.

@miku
miku / dial-pq-via-ssh.go
Created April 13, 2020 23:10 — forked from vinzenz/dial-pq-via-ssh.go
Use postgres via SSH in Golang
package main
import (
"database/sql"
"database/sql/driver"
"fmt"
"net"
"os"
"time"
@miku
miku / .gitignore
Last active March 5, 2020 23:25
Like zcat but reads one or more files from stdin (e.g. from find)
/zrcat
"""
Take a CSV from:
psql fatcat_prod -c "COPY (select id, doi, release_stage, work_ident_id from release_rev where extra_json->>'datacite' is not null) TO '/tmp/datacite-throwaway.csv' WITH CSV DELIMITER ',';"
and generate ingest requests, one per line.
"""
from __future__ import print_function
@miku
miku / download_github_organization_stats.py
Created January 5, 2020 12:53 — forked from s-m-e/download_github_organization_stats.py
Download basic statistics for all repositories in list of GitHub organizations
#!/usr/bin/env python
# Python 3
import datetime
import json
import os
from github import Github # pip install PyGithub
ORGANIZATIONS = ['my_organization', 'some_other_organization']
@miku
miku / datacite.json
Last active December 16, 2019 17:38
Example datacite record.
{
"id": "10.7916/d8-f93n-rk51",
"type": "dois",
"attributes": {
"doi": "10.7916/d8-f93n-rk51",
"identifiers": [
{
"identifier": "https://doi.org/10.7916/d8-f93n-rk51",
"identifierType": "DOI"
}
@miku
miku / cursor400.sh
Last active December 4, 2019 15:09
Trying to reproduce a HTTP 400 on datacite api v2 using cursor.
#!/bin/bash
# To reproduce, run script and wait a bit, until it stop; last line should be a
# (22) from curl.
#
# $ bash cursor400.sh
# ...
# curl: (22) The requested URL returned error: 400
set -eu -o pipefail
@miku
miku / .gitignore
Last active November 4, 2019 13:20
ISIL offline
data.json*
# Install these packages (use your favorite AUR tool here)
yay -S minikube-bin kubectl-bin docker-machine-driver-kvm2 libvirt qemu-headless docker-machine ebtables
# Get libvirt going
sudo systemctl enable libvirtd.service
sudo usermod -a -G libvirt $(whoami)
# This fix thanks to http://blog.programmableproduction.com/2018/03/08/Archlinux-Setup-Minikube-using-KVM/
sudo virsh net-autostart default
@miku
miku / wheeler.md
Created August 20, 2019 22:23 — forked from kimsk/wheeler.md
THE USE OF SUB-ROUTINES IN PROGRAMMES

D. J. Wheeler

Cambridge & Illinois Universities

A sub-routine may perhaps best be described as a self-contained part of a programme, which is capable of being used in different programmes. It is an entity of its own within a programme. There is no necessity to compose a programme of a set of distinct sub-routines; for the programme can be written as a complete unit, with no divisions into smaller parts. However it is usually advantageous to arrange that a programme is comprised of a set of subroutines, some of which have been made specially for the particular programme while others are available from a library of standard sub-routines. The reasons for this will be discussed below.

When a programme has been made from a set of sub-routines the breakdown of the code is more complete than it would otherwise be. This allows the coder to concentrate on one section of a programme at a time without the overall detai

We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
OK 1530-1311 Temporal Representation and Reasoning https://portal.issn.org/resource/ISSN/2332-6468
OK 1641-6554 Kolposkopia
NA Computers in Cardiology Conference
OK 1089-7771 IEEE transactions on information technology in biomedicine. https://portal.issn.org/resource/ISSN/1089-7771
OK 1093-1139 Academic physician and scientist https://portal.issn.org/resource/ISSN/1093-1139
OK 1088-7725 AUTOTESTCON https://portal.issn.org/resource/ISSN/1088-7725
OK 1527-4160 Journal of psychiatric practice https://portal.issn.org/resource/ISSN/1538-1145