Skip to content

Instantly share code, notes, and snippets.

@ckiee
Last active May 25, 2021 13:26
Show Gist options
  • Save ckiee/c9ab861e4f98c50c20778da7bc0a38ad to your computer and use it in GitHub Desktop.
Save ckiee/c9ab861e4f98c50c20778da7bc0a38ad to your computer and use it in GitHub Desktop.

Revisions

  1. ckiee revised this gist May 25, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gh-nixpkgs.js
    Original file line number Diff line number Diff line change
    @@ -16,5 +16,5 @@
    const bits = location.pathname.split("/");
    const id = bits[bits.length-1];

    bar.innerHTML += `<a href="https://nixpk.gs/pr-tracker.html?pr=${id}">View on nixpk.gs</a>`;
    bar.innerHTML += `<a href="https://nixpk.gs/pr-tracker.html?pr=${id}" target=_blank>View on nixpk.gs</a>`;
    })();
  2. ckiee created this gist May 25, 2021.
    20 changes: 20 additions & 0 deletions gh-nixpkgs.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    // ==UserScript==
    // @name GitHub nixpk.gs
    // @namespace http://tampermonkey.net/
    // @version 0.1
    // @description add a nixpk.gs quick link on nixpkgs github PRs
    // @author ronthecookie <[email protected]>
    // @match https://github.com/NixOS/nixpkgs/pull/*
    // @icon https://www.google.com/s2/favicons?domain=github.com
    // @grant none
    // ==/UserScript==

    (function() {
    'use strict';

    const bar = document.querySelector(".gh-header-meta");
    const bits = location.pathname.split("/");
    const id = bits[bits.length-1];

    bar.innerHTML += `<a href="https://nixpk.gs/pr-tracker.html?pr=${id}">View on nixpk.gs</a>`;
    })();