Skip to content

Instantly share code, notes, and snippets.

View lydell's full-sized avatar

Simon Lydell lydell

View GitHub Profile
@lydell
lydell / .eslintrc.js
Created September 27, 2016 08:22
eslint-brunch + eslint-config-standard
module.exports = {
extends: 'eslint-config-standard',
}
@lydell
lydell / .stylelintrc.js
Created December 6, 2016 06:09
Stylelint bug
module.exports = {
extends: 'stylelint-config-standard',
}
module.exports = {
'plugins': ['flowtype', 'prettier'],
"globals": {
"window": true
},
'rules': {
'import/extensions': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
@lydell
lydell / background.js
Last active February 18, 2017 11:11
WebExtension .focus() tests
"use strict";
function onError(error) {
console.error(`Error: ${error}`);
}
function sendMessageToTabs(tabs) {
for (let tab of tabs) {
browser.tabs.sendMessage(
tab.id,
@lydell
lydell / .eslintrc.js
Last active September 22, 2017 09:29
Generates .flowconfig regexps that ignores everything in `node_modules/` except the given modules.
module.exports = {
extends: [
"strict",
"prettier",
],
parserOptions: {
ecmaVersion: 2016,
},
plugins: ["prettier"],
rules: {
@lydell
lydell / _glyphicons.scss
Created May 29, 2017 07:20
Prettier SCSS
@font-face {
src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.eot'), '#{$icon-font-path}#{$icon-font-name}.eot'));
}
// Catchall baseclass
.glyphicon {}
// Individual icons
.glyphicon-asterisk {}
@lydell
lydell / _glyphicons.scss
Created May 29, 2017 17:47
Prettier SCSS, round 2
@font-face {
src: url(if($bootstrap-sass-asset-helper, twbs-font-path('#{$icon-font-path}#{$icon-font-name}.eot'), '#{$icon-font-path}#{$icon-font-name}.eot'));
}
// Catchall baseclass
.glyphicon {}
// Individual icons
.glyphicon-asterisk {}
@lydell
lydell / main.tex
Created December 28, 2017 14:26
LaTeX pagestyle confusion
\documentclass[twoside]{article}
\usepackage{fancyhdr}
\usepackage{extramarks}
\setlength{\headheight}{14pt}
\fancypagestyle{ttlpage}{
\fancyhf{}
\fancyhead[L]{First page head}

Keybase proof

I hereby claim:

  • I am lydell on github.
  • I am lydell (https://keybase.io/lydell) on keybase.
  • I have a public key whose fingerprint is C9F5 C6D9 0520 8814 3C8F 19AD DDEF 57C7 3914 C7EF

To claim this, I am signing this object:

@lydell
lydell / draw-rect.js
Last active October 8, 2020 17:38
Visualize .getBoundingClientRect()
function draw(rect) {
const div = document.createElement("div");
// Might be needed on crazy pages, but makes the console output for the div crazy large.
// div.style.all = "unset";
div.style.position = "absolute";
div.style.zIndex = "2147483647";
// At least _try_ to scroll along. Won’t work for inner scroll.
div.style.left = `${window.scrollX + rect.left}px`;
div.style.top = `${window.scrollY + rect.top}px`;
div.style.width = `${rect.width}px`;