Skip to content

Instantly share code, notes, and snippets.

View matijs's full-sized avatar
:dependabot:
Scouting turtles

matijs matijs

:dependabot:
Scouting turtles
View GitHub Profile
@matijs
matijs / ts.user.js
Created June 13, 2011 15:13
Remove the title attribute when it's the same as the innerText of an anchor
// ==UserScript==
// @name Title stripper
// @author Matijs Brinkhuis
// @namespace http://github.com/matijs
// @version 0.1
// @description Remove the title attribute when it's the same as the innerText of an anchor
// @include http://frontpage.fok.nl/*
// ==/UserScript==
[].forEach.call(document.querySelectorAll("a[title]"), function(el) { el.innerText === el.title && el.removeAttribute("title"); });
@matijs
matijs / gist:1023202
Created June 13, 2011 17:09
Bookmarklet to remove `title` attributes from anchors
javascript:[].forEach.call(document.querySelectorAll("a[title]"),function(el){el.innerText===el.title&&el.removeAttribute("title")});
@matijs
matijs / utmstrip.user.js
Created September 22, 2011 16:30 — forked from paulirish/utmstrip.user.js
userscript: Drop the UTM params from a URL when the page loads
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.1
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http://*
// ==/UserScript==
@matijs
matijs / gist:3237085
Created August 2, 2012 13:24 — forked from icaaq/gist:3235454
triggers click on spacebar key
/*
MDN: using the button role https://developer.mozilla.org/en/Accessibility/ARIA/ARIA_Techniques/Using_the_button_role
-----
Warning: Be careful when marking up links with the button role. Buttons are expected to be triggered using the Space key,
while links are expected to be triggered through the Enter key. In other words, when links are used to behave like buttons,
adding role="button" alone is not sufficient. It will also be necessary to add a key event handler that listens for the
Space key in order to be consistent with native buttons.
-----
*/
@matijs
matijs / load_jquery_bookmarklet.js
Created November 13, 2012 13:13
Bookmarklet to add jQuery to the current document
javascript:(function(){
if ('jQuery' in window) {
console.log('jQuery '+jQuery.fn.jquery+' already present');
}
else {
var s = document.createElement('script');
s.src = 'http://code.jquery.com/jquery.min.js';
s.onload = function() {
console.log('jQuery '+jQuery.fn.jquery+' loaded.');
};
@matijs
matijs / index.html
Created November 13, 2012 14:29
bookmarklet to open the smallest valid html5 document
data:text/html;charset=utf-8,<!doctype html><title></title>
@matijs
matijs / Solarized (Dark).tmTheme
Created November 13, 2012 15:38
Solarized Dark WITH semitransparent line highlight
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Solarized (dark)</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@matijs
matijs / nginx-build.sh
Created November 18, 2012 21:44
nginx build options
./configure \
--prefix=/usr/local/nginx \
--with-http_ssl_module \
--with-pcre=../pcre-8.20
@matijs
matijs / pcre-build.sh
Created November 18, 2012 22:33
PCRE build options
./configure \
--prefix=/usr/local
@matijs
matijs / index.html
Created December 10, 2012 11:09
star rating
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Star rating</title>
<style>
html { background: slategrey; color: ivory; font-family: Helvetica, Arial, sans-serf; font-size: 16px; }
body { margin: 2em; }
.result { background: ivory; border-radius: 1em; border: 2px solid darkslategrey; color: darkslategrey; font-size: 1em; overflow: hidden; text-shadow: 0 1px 1px rgba(0,0,0,0.4); width: 6em; }