Skip to content

Instantly share code, notes, and snippets.

View mnewt's full-sized avatar

Matthew Newton mnewt

View GitHub Profile
@mnewt
mnewt / bootstrap-tabs.html
Created December 6, 2012 20:28
bootstrap tabs example
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Le styles -->
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
</head>
<body>
@mnewt
mnewt / print_dom_tree1.js
Created December 18, 2012 20:12
print dom tree
<SCRIPT LANGUAGE="JavaScript">
<!--
// F. Permadi 2005.
// (C) F. Permadi
// Print DOM tree
////////////////////////////////////////////
// This function traverses the DOM tree of an element and prints the tree.
// This function called recursively until the DOM tree is fully traversed.
//
// Parameters:
@mnewt
mnewt / proxy-toggle.sh
Created September 13, 2012 20:00
trivial command to toggle Mac OS X SOCKS proxy
#!/bin/sh
PROXY_INTERFACE="USB Ethernet"
PROXY_HOST=localhost
PROXY_PORT=1080
if [[ $1 == "on" ]]; then
sudo networksetup -setsocksfirewallproxy "$PROXY_INTERFACE" $PROXY_HOST $PROXY_PORT
echo "SOCKS proxy enabled"
@mnewt
mnewt / torrentz2_magnet_links.user.js
Last active February 19, 2021 18:25
Add magnet links to Torrentz2
@mnewt
mnewt / *lsp-log*
Last active September 1, 2020 18:11
GDScript warnings example
[Trace - 03:27:31 PM] Sending request 'textDocument/documentLink - (346)'.
Params: {
"textDocument": {
"uri": "file:///Users/mn/Dropbox/Matt/code/Finnland/Player.gd"
}
}
[Trace - 03:27:31 PM] Received response 'textDocument/documentLink - (346)' in 41ms.
Result: []
@mnewt
mnewt / gccemacs.rb
Created August 17, 2020 16:52
Work in progress attempt at using homebrew to build and install a GUI app
class Emacs < Formula
desc "GNU Emacs Native Compiled"
homepage "https://akrl.sdf.org/gccemacs.html"
head "git://git.sv.gnu.org/emacs.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
mnewt / limetorrents_magnet_links.user.js
Created August 7, 2020 20:19
Add magnet links to Limetorrents
@mnewt
mnewt / mac-database.txt
Created November 7, 2012 22:11
mac address lookup script
# $Id$ generated with make-mac-prefixes.pl
# Original data comes from http://standards.ieee.org/regauth/oui/oui.txt
# These values are known as Organizationally Unique Identifiers (OUIs)
# See http://standards.ieee.org/faqs/OUI.html
# We have added a few unregistered OUIs at the end.
000000 Xerox
000001 Xerox
000002 Xerox
000003 Xerox
000004 Xerox
@mnewt
mnewt / keybase.md
Last active September 16, 2019 17:15
keybase.md

Keybase proof

I hereby claim:

  • I am mnewt on github.
  • I am mnewt (https://keybase.io/mnewt) on keybase.
  • I have a public key ASBr9rFhvh1zj6ZXu6Zvi7j0G4trGLu-ze6rKtNH8_HOfwo

To claim this, I am signing this object:

@mnewt
mnewt / pw
Created April 17, 2015 03:49
Fun Password Generator
#!/usr/bin/env python3
"""
Generate random passwords. Mainly useful for copying and pasting
into password managers
"""
import argparse, random, string, sys, unicodedata, re