Skip to content

Instantly share code, notes, and snippets.

View MTco's full-sized avatar
😞

Mathew Tyler MTco

😞
View GitHub Profile
@MTco
MTco / AddToWishList.html
Created October 2, 2018 22:08 — forked from drifterz28/AddToWishList.html
Universal "Add to Amazon Wish List"
<div style="display: none;" id="AUWLBkURL.{ITEM_ID}">http://theurl.com</div>
<div style="display: none;" id="AUWLBkPrice.{ITEM_ID}">12.00</div>
<div style="display: none;" id="AUWLBkTitle.{ITEM_ID}">Test Item</div>
<div style="display: none;" id="AUWLBkImage.{ITEM_ID}">http://theimage.com/image.png</div>
<script
id="AddToAUWLButton.{ITEM_ID}"
language="JavaScript1.2"
type="text/javascript"
src="http://www.amazon.com/wishlist/bookmarklet/getbutton.js?name={ITEM_ID}&image=2">
</script>
@MTco
MTco / kill-sticky.js
Last active August 23, 2018 16:51 — forked from alisdair/kill-sticky.js
Kill sticky headers.
(function(uw,l,o){
try{
uw=uw!==void 0?uw:window;
l=uw.document;
o.els=l.querySelectorAll('body *');
o.strlngth=o.els.length;
for(o.i=0;o.i<=o.strlngth;o.i++){
o.el=o.els[o.i];
if( o.checkFor.includes(getComputedStyle(o.el).position) ){
o.el.parentNode.removeChild(o.el);
@MTco
MTco / rss2html.php
Created June 18, 2018 20:53 — forked from zma/rss2html.php
rss2html.php
<?php
// Check http://www.systutorials.com/136102/a-php-function-for-fetching-rss-feed-and-outputing-feed-items-as-html/ for description
// RSS to HTML
/*
$tiem_cnt: max number of feed items to be displayed
$max_words: max number of words (not real words, HTML words)
if <= 0: no limitation, if > 0 display at most $max_words words
*/
@MTco
MTco / ViewSourceWith.ps1
Created May 7, 2018 17:34 — forked from svenk/ViewSourceWith.ps1
A Firefox Quantum ViewSourceWith extension workaround with Firefox's source.editor.external
# A Firefox Quantum ViewSourceWith replacement for Windows
#
# Usage:
# (1) Save as C:\path\to\script.ps1
# (2) In order to run your own powershell scripts, start PowerShell
# as Administrator and run the command
#
# Set-ExecutionPolicy RemoteSigned
#
# (2) You can test the proper running (from a user cmd):
@MTco
MTco / getAddress.gs
Created February 27, 2018 22:21 — forked from andrewroberts/getAddress.gs
Google Sheets custom function to get Google's best guess at the address of a place.
function GET_ADDRESS(placeName) {
var response = Maps.newGeocoder().geocode(placeName);
return response.results[0].formatted_address 
}
@MTco
MTco / fillInHtmlTemplate.gs
Created February 27, 2018 22:18 — forked from andrewroberts/fillInHtmlTemplate.gs
Google Apps Script function to replace placeholder values in an HTML template (from a draft GMail for example)
/**
* For each placeholder - "{{[placeholder]}}", strip out any HTML and replace
* it with the appropriate key value. An example use of this could be using the
* HTML from a draft GMail as a template.
*
* E.g. If the obect were:
*
* {PlaceHolder1: newValue}
*
* In the template "{{PlaceHolder1}}" would be replaced with "newValue" even
// ==UserScript==
// @name GM_download emulation
// @namespace http://tampermonkey.net/
// @version 0.1
// @description emulate GM_download functionality
// @require https://github.com/eligrey/FileSaver.js/raw/master/FileSaver.js
// @match http://tampermonkey.net/empty.html
// @grant GM_xmlhttpRequest
// @copyright 2014, Jan Biniok
// ==/UserScript==
@MTco
MTco / index.html
Created June 5, 2017 22:48 — forked from dgrijuela/index.html
Code for the article How to Make Your Blog Work Offline: https://blog.redradix.com/how-to-make-your-blog-work-offline
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script>
// Test if service workers are supported
if ('serviceWorker' in navigator) {
@MTco
MTco / api-tester.user.js
Created June 3, 2017 22:19 — forked from arantius/api-tester.user.js
General purpose Greasemonkey Tester
// ==UserScript==
// @name Greasemonkey Tester
// @name:en-US Greasemonkey Tester (en-US)
// @name:fr La Tester Sur Greasemonkey
// @namespace https://github.com/arantius
// @include http://localhost/infinite.php?*
// @match http://localhost/infinite.php*
// @exclude /.*0$/
// @resource R https://gist.github.com/arantius/1157543/raw/data.txt
// @icon http://icons.iconarchive.com/icons/chicho21net/jungle-bells/48/CocoDrilo-icon.png
@MTco
MTco / uri.js
Created April 3, 2017 19:55 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"