Skip to content

Instantly share code, notes, and snippets.

:octocat:
Turtle hunting

Matijs Brinkhuis matijs

:octocat:
Turtle hunting
Block or report user

Report or block matijs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matijs
matijs / README.md
Last active Nov 15, 2019
Solarized Dark profile for macOS Terminal.app
View README.md

Solarized Dark profile for Terminal.app on macOS High Sierra

Based on the excellent Solarized (Dark) created by Ethan Schoonover. For source code, check the main Solarized repository on GitHub.

Installation

Open and save Solarized Dark.terminal.

Import from the “Profiles” tab in the settings of Terminal.app or just double-click the file after downloading.

@matijs
matijs / keybindings.json
Created Nov 20, 2017
Visual Studio Code Keybindings
View keybindings.json
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+shift+k",
"command": "editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "shift+cmd+k",
"command": "-editor.action.deleteLines",
@matijs
matijs / settings.json
Created Nov 20, 2017
Visual Studio Code User Settings
View settings.json
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Source Code Pro",
"editor.fontSize": 14,
"editor.renderWhitespace": "all",
"editor.renderIndentGuides": false,
"editor.selectionHighlight": false,
"files.insertFinalNewline": true,
"workbench.colorTheme": "Solarized Dark",
"workbench.iconTheme": "vs-minimal",
View keepmain.js
(function(doc, body) {
const main = doc.querySelector('main').parentNode.removeChild(doc.querySelector('main'));
while (body.firstChild) body.removeChild(body.firstChild);
body.appendChild(main)
}(document, document.body));
@matijs
matijs / switcher-es5.js
Last active Dec 8, 2016
Stylesheet switcher sans ES6 features
View switcher-es5.js
(function() {
window.addEventListener( 'load', function() {
var links = Array.prototype.slice.call( document.querySelectorAll( 'link[title]') );
var uniqueTitles = links.reduce( function( titles, link ) {
if ( titles.indexOf( link.title ) === -1 ) {
titles.push( link.title );
}
return titles;
}, []);
var title = window.sessionStorage && window.sessionStorage.getItem( 'title' ) || '';
@matijs
matijs / switcher.js
Created Dec 8, 2016
Stylesheet Switcher
View switcher.js
(function() {
const links = Array.from( document.querySelectorAll( 'link[title]' ) );
const styles = Array.from( new Set( links.map( link => link.title ) ) );
let title = localStorage.getItem( 'title' );
function selectStyle( title ) {
links.forEach( link => {
link.disabled = true;
link.disabled = link.title !== title;
});
@matijs
matijs / camelCase.js
Last active Nov 3, 2016
Convert foo-bar-baz into a camelCased version
View camelCase.js
const camelCase = str => str.split( /[_,-]+/ ).map( ( item, index ) => index === 0 ? item : item.charAt(0).toUpperCase() + item.slice(1).toLowerCase()
).join('');
@matijs
matijs / classList.js
Last active May 14, 2019
Element.prototype.classList polyfill
View classList.js
if ( 'document' in self ) {
// Full polyfill for browsers with no classList support
// Including IE < Edge missing SVGElement.classList
if ( !( 'classList' in document.createElement( '_' ) )
|| document.createElementNS && !( 'classList' in document.createElementNS( 'http://www.w3.org/2000/svg', 'g' ) ) ) {
( function( view ) {
'use strict';
var DOMEx;
@matijs
matijs / .scss-lint.yml
Last active Aug 4, 2016
All SCSS Linter options, quite restrictive, see https://github.com/brigade/scss-lint/blob/master/lib/scss_lint/linter/README.md for an explanation of the options.
View .scss-lint.yml
---
linters:
BangFormat:
space_before_bang: true
space_after_bang: false
BemDepth:
enabled: false
BorderZero:
enabled: true
convention: none
View isInteractiveElement.js
function isInteractiveElement( element ) {
if ( [ 'A', 'BUTTON', 'DETAILS', 'EMBED', 'IFRAME', 'KEYGEN', 'LABEL', 'SELECT', 'TEXTAREA' ].indexOf( element.nodeName ) !== -1 ) {
return true;
}
if ( element.nodeName === 'INPUT' && element.type !== 'hidden' ) {
return true;
}
if ( ['AUDIO', 'VIDEO'].indexOf( element.nodeName ) > -1 && element.hasAttribute('controls') ) {
return true;
}
You can’t perform that action at this time.