Skip to content

Instantly share code, notes, and snippets.

View MTco's full-sized avatar
😞

Mathew Tyler MTco

😞
View GitHub Profile
@MTco
MTco / kindle.meta.js
Created March 8, 2020 19:37 — forked from Shaked/kindle.meta.js
Kindle Keywords Exporter
// ==UserScript==
// @name KindleKeywordsExporter
// @namespace https://kindle.amazon.com/your_highlights
// @version 0.0.8
// @downloadURL https://gist.github.com/raw/65e198dcda8784c557075b9b89265a16/kindle.user.js
// @updateURL https://gist.github.com/raw/65e198dcda8784c557075b9b89265a16/kindle.meta.js
// @description Helps exporting highlighted keywords from Kindle
// @include https://kindle.amazon.com/your_highlights
// @match https://kindle.amazon.com/your_highlights
// @grant GM_setValue
@MTco
MTco / dabblet.css
Created March 8, 2020 00:10 — forked from Potherca/dabblet.css
CSS Only Warning Sign
@charset "UTF-8"
@import url(http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono);
/**
* CSS Only Warning Sign
*
* Live preview available at: http://dabblet.com/gist/6937981
*
* A lot of website use an icon of a warning sign to display next to important
* text.
@MTco
MTco / evernote.js
Created January 30, 2020 22:07 — forked from lindseycholmes/evernote.js
Evernote bookmarklet
CmdUtils.makeBookmarkletCommand({
name: "Evernote",
description: "Save a note on Evernote.",
icon: "http://www.evernote.com/favicon.ico",
homepage: "http://www.makadia.com",
author: {name: "Svapan Makadia", email: "codewzrd@hotmail.com"},
help: "Select content and invoke this command to save the selection as a note or just save the whole page without selecting anything.",
url: "javascript:(function(){EN_CLIP_HOST='http://www.evernote.com';try{var%20x=document.createElement('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new%20Date().getTime()/100000);document.getElementsByTagName('head')[0].appendChild(x);}catch(e){location.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);}})();"
})
@MTco
MTco / evernote.js
Created January 30, 2020 22:07 — forked from fvdm/evernote.js
CmdUtils.makeBookmarkletCommand({
name: "Evernote",
description: "Save a note on Evernote.",
icon: "http://www.evernote.com/favicon.ico",
homepage: "http://www.makadia.com",
author: {name: "Svapan Makadia", email: "codewzrd@hotmail.com"},
help: "Select content and invoke this command to save the selection as a note or just save the whole page without selecting anything.",
url: "javascript:(function(){EN_CLIP_HOST='http://www.evernote.com';try{var%20x=document.createElement('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new%20Date().getTime()/100000);document.getElementsByTagName('head')[0].appendChild(x);}catch(e){location.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);}})();"
})
@MTco
MTco / HowToOTG.md
Created December 19, 2019 19:14 — forked from gbaman/HowToOTG.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@MTco
MTco / DNSMasq_withMalwareBlocking.md
Created October 18, 2019 23:54 — forked from erlepereira/DNSMasq_withMalwareBlocking.md
Using DNSMasq as a caching nameserver & add in a malware etc blocking

Assuming a Properly configured DNSMasq

a quickstart for dnsmasq is given at the end if you have not set it up yet.

something like this will add a great regularly updated malware file for it to use. More security and privacy to you! Specifically, this uses https://github.com/StevenBlack/hosts Choose one of the Raw Hosts file from there to use.

To setup DNSMasq, follow the below ...

wget -O- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | awk '$1 == "0.0.0.0" { print "address=/"$2"/0.0.0.0/"}' > /etc/dnsmasq.d/malware.conf`
@MTco
MTco / gist:e474faf494523d7b624714911b282fe3
Created August 2, 2019 18:45 — forked from gorhill/gist:ef1b62d606473c68d524
Disqus comments widget: on-demand
! Title: Disqus click-to-load
# Copy-paste the static filters below into your "My filters" pane in the
# dashboard.
# Purpose is to load Disqus comments on demand only, so that no connection
# to `disqus.com` occurs by default when you land on a site which uses
# Disqus comments widget.
# Not connecting to Disqus by default is a good thing for such a
# ubiquitous server as `disqus.com`, which can be used to build a
@MTco
MTco / elementInViewport.js
Created June 30, 2019 19:04 — forked from vincentorback/elementInViewport.js
Check if element is in viewport
/**
* Check if element is in viewport
* @param {Node} el
* @return {Object}
*/
export function elementInViewport(el) {
let top = el.offsetTop;
let left = el.offsetLeft;
let width = el.offsetWidth;
let height = el.offsetHeight;
@MTco
MTco / countries.json
Created May 11, 2019 18:23 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@MTco
MTco / github-html-preview-monkey.js
Last active May 4, 2019 20:27 — forked from vanyakosmos/github-html-preview-monkey.js
Script for Tampermonkey that adds 'view' to the actions menu beside 'row', 'blame' and 'history' buttons and allow you to preview rendered .html pages.
// ==UserScript==
// @encoding utf-8
// @name Github html preview
// @author https://github.com/vaniakosmos
// @modified-by Mathew Tyler <hi@mathewtyler.co> (http://mathewtyler.co)
// @version 1.1
// @description Shortcut for htmlpreview.github.io
// @grant none
// @run-at document-end
// @match https://github.com/**/*.html