Skip to content

Instantly share code, notes, and snippets.

View swernerx's full-sized avatar

Sebastian Werner swernerx

View GitHub Profile
@swernerx
swernerx / AutoScrollToTop.js
Last active January 7, 2019 11:33
Automatic top scrolling in harmony with browsers native book keeping for @reach/router
import { Location } from '@reach/router'
import React from 'react'
let lastNavigationFromBrowserUI = true
if (typeof window !== 'undefined') {
window.addEventListener('popstate', event => {
lastNavigationFromBrowserUI = true
})
}
/* 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 April 26, 2018 07:18
Showcasing babel+fast-async issue
{
"presets": [
[ "@babel/env", {
// "loose": true,
"exclude":
["transform-regenerator", "transform-async-to-generator"]
}
]
],
@swernerx
swernerx / checkSpelling.js
Last active January 18, 2018 13:15
Check translation files for spelling issues using the hunspell based "node-spellchecked"
#!/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)) {

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: