Skip to content

Instantly share code, notes, and snippets.

Avatar

Sebastian Werner swernerx

View GitHub Profile
@swernerx
swernerx / AutoScrollToTop.js
Last active Jan 7, 2019
Automatic top scrolling in harmony with browsers native book keeping for @reach/router
View AutoScrollToTop.js
import { Location } from '@reach/router'
import React from 'react'
let lastNavigationFromBrowserUI = true
if (typeof window !== 'undefined') {
window.addEventListener('popstate', event => {
lastNavigationFromBrowserUI = true
})
}
View loader.js
/* eslint-disable max-params */
import steed from "steed"
import loaderUtils from "loader-utils"
function resolveImageSrc(loaderContext, image, callback) {
if (typeof image.src !== "string") {
return callback(
new Error('Missing image "src" property in Web App Manifest')
)
@swernerx
swernerx / .babelrc
Last active Apr 26, 2018
Showcasing babel+fast-async issue
View .babelrc
{
"presets": [
[ "@babel/env", {
// "loose": true,
"exclude":
["transform-regenerator", "transform-async-to-generator"]
}
]
],
@swernerx
swernerx / checkSpelling.js
Last active Jan 18, 2018
Check translation files for spelling issues using the hunspell based "node-spellchecked"
View checkSpelling.js
#!/usr/bin/env node
const checker = require('spellchecker');
const chalk = require('chalk');
const glob = require('glob');
const root = require('app-root-dir').get();
const fs = require('fs-extra');
function check(word) {
if (checker.isMisspelled(word)) {
View keybase.md

Keybase proof

I hereby claim:

  • I am swernerx on github.
  • I am swerner (https://keybase.io/swerner) on keybase.
  • I have a public key whose fingerprint is EB1B E296 359A 3CB7 BE29 5E51 4716 C892 C888 FF70

To claim this, I am signing this object:

You can’t perform that action at this time.