Skip to content

Instantly share code, notes, and snippets.


Matthew Newton mnewt

View GitHub Profile
mnewt / *lsp-log*
Last active September 1, 2020 18:11
GDScript warnings example
View *lsp-log*
[Trace - 03:27:31 PM] Sending request 'textDocument/documentLink - (346)'.
Params: {
"textDocument": {
"uri": "file:///Users/mn/Dropbox/Matt/code/Finnland/"
[Trace - 03:27:31 PM] Received response 'textDocument/documentLink - (346)' in 41ms.
Result: []
mnewt / gccemacs.rb
Created August 17, 2020 16:52
Work in progress attempt at using homebrew to build and install a GUI app
View gccemacs.rb
class Emacs < Formula
desc "GNU Emacs Native Compiled"
homepage ""
head "git://", :branch => "feature/native-comp"
depends_on "autoconf" => :build
depends_on "pkg-config" => :build
depends_on "texinfo" => :build
depends_on "gcc"
depends_on "gnupg"
mnewt / limetorrents_magnet_links.user.js
Created August 7, 2020 20:19
Add magnet links to Limetorrents
View limetorrents_magnet_links.user.js
mnewt / torrentz2_magnet_links.user.js
Last active February 19, 2021 18:25
Add magnet links to Torrentz2
View torrentz2_magnet_links.user.js
mnewt / dsr.js
Last active May 3, 2018 21:25
Get the current column and row in the terminal using ANSI Device Status Report
View dsr.js
#!/usr/bin/env node
// Loosely based on
'use strict';
var deasync = require('deasync');
function asyncDSR(opts, callback) {
// opts is an optional object:
// { in: input }
mnewt /
Last active September 16, 2019 17:15

Keybase proof

I hereby claim:

  • I am mnewt on github.
  • I am mnewt ( on keybase.
  • I have a public key ASBr9rFhvh1zj6ZXu6Zvi7j0G4trGLu-ze6rKtNH8_HOfwo

To claim this, I am signing this object:

mnewt / source.cljs
Created November 6, 2017 04:33
Lumo script demonstrating environment variable exports
View source.cljs
(require '[ :refer [diff]])
(def ^:no-doc fs (js/require "fs"))
(def ^:no-doc child-process (js/require "child_process"))
(def ^:no-doc os (js/require "os"))
(def ^:no-doc path (js/require "path"))
(def ignore-env-vars #{"_" "OLDPWD" "PWD" "SHELLOPTS" "SHLVL"})
(defn mktemp
mnewt /
Created June 16, 2017 14:52
Download a file iff URL's HTTP If-Modified-Since header is more recent than the local file timestamp
#!/usr/bin/env bash
# Download a file iff URL's HTTP If-Modified-Since header is more recent than
# the local file timestamp
shift 2
curl -z "$file" -Lo "$file" "$url" "$@"
mnewt / gh-download-latest
Created May 20, 2017 21:33
Shell script to download a github project's latest release
View gh-download-latest
# Download a github project's latest release
# $1: username/repo
# $2: regex to match download file
# example: ./gh-download-latest atom/atom gz
wget -qO-$repo/releases/latest | \
mnewt / mark_read.php
Created May 16, 2017 18:51
Search for matching miniflux items and mark them as read
View mark_read.php
#!/usr/bin/env php
require __DIR__.'/miniflux/app/common.php';
use PicoDb\Database;
use Miniflux\Model\Item;
if (php_sapi_name() !== 'cli') {