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 / README.md
Last active February 22, 2024 05:35
Solarized Dark profile for macOS Terminal.app

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 November 20, 2017 10:41
Visual Studio Code Keybindings
// 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 November 20, 2017 10:33
Visual Studio Code User Settings
// 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",
(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 December 8, 2016 22:47
Stylesheet switcher sans ES6 features
(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 December 8, 2016 15:25
Stylesheet Switcher
(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 November 3, 2016 14:18
Convert foo-bar-baz into a camelCased version
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 20:44
Element.prototype.classList polyfill
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 August 4, 2016 10:36
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.
---
linters:
BangFormat:
space_before_bang: true
space_after_bang: false
BemDepth:
enabled: false
BorderZero:
enabled: true
convention: none
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;
}