Skip to content

Instantly share code, notes, and snippets.

View lydell's full-sized avatar

Simon Lydell lydell

View GitHub Profile
[
[" ",1988063],
["e",1162450],
["a",888755],
["t",832684],
["i",762070],
["n",746426],
["o",728126],
["r",667531],
["s",655854],
@lydell
lydell / index.js
Last active August 29, 2015 14:08
convert-source-map-simple
var sourceMap = require("source-map")
function convert(map) {
var simpleMap = shallowCopy(map)
// Prevent the source-map module from joining sources with the sourceRoot (if
// any), so that we can find the indexes of in the `sources` property.
delete simpleMap.sourceRoot
simpleMap.mappings = {}
@lydell
lydell / tokenize.coffee
Created December 19, 2014 16:17
Simple tokenizer function (for js-tokens and css-tokens)
###
Tokenizes `string` into an array of tokens, using `regex` such as [js-tokens]
or [css-tokens].
[js-tokens]: https://github.com/lydell/js-tokens
[css-tokens]: https://github.com/lydell/css-tokens
###
tokenize = (string, regex) ->
regex.lastIndex = 0
<!doctype html>
<title>test</title>
<style>
a:hover::after {
content: ':hover';
}
a:focus::after {
content: ':focus';
}
a:active::after {
@lydell
lydell / base64.css
Created September 4, 2016 09:47
Embedded source map support test
.base64 { font-weight: bold; }
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VzIjpbInN1Y2Nlc3MuY3NzIl0sIm5hbWVzIjpbXX0= */
@lydell
lydell / LessCrazy.elm
Last active September 21, 2016 09:10
Crazy elm
module Main exposing (..)
import Html exposing (Html, div, button, text)
import Html.App
import Html.Events exposing (onClick)
main : Program Never
main =
Html.App.beginnerProgram
@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',
}
@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 / _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 {}