Skip to content

Instantly share code, notes, and snippets.

View jacksteamdev's full-sized avatar

Jack Steam jacksteamdev

View GitHub Profile
import { build, files, version } from '$service-worker';
// https://github.com/microsoft/TypeScript/issues/11781 - this is needed for TS and ESLint
/// env serviceworker
const globalThis = /** @type {unknown} */ (self);
/// <reference no-default-lib="true"/>
/// <reference lib="es2020" />
/// <reference lib="WebWorker" />
const sw = /** @type {ServiceWorkerGlobalScope & typeof globalThis} */ (globalThis);
@raftheunis87
raftheunis87 / eslint-prettier-typescript
Last active January 26, 2023 16:55
ESLint with airbnb and Prettier for Typescript
1) install dependencies:
yarn add @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-airbnb-typescript eslint-config-prettier eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks prettier --dev
2) create .eslintrc.js file:
```
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
extends: [
@asartalo
asartalo / e2e.js
Created September 22, 2019 04:24
Hacky Testing Firefox extension with Selenium Webdriver
const { Builder, By, Key, until } = require('selenium-webdriver');
const firefox = require('selenium-webdriver/firefox');
const Command = require('selenium-webdriver/lib/command').Command;
const path = require('path');
const options = new firefox.Options()
.setPreference('extensions.firebug.showChromeErrors', true);
(async function example() {
let driver = await new Builder()
@jacksteamdev
jacksteamdev / rxjs-log-step-final.ts
Last active October 6, 2021 13:40 — forked from caroso1222/rxjs-log-step-final.ts
RxJS Log Operator
import { Observable } from 'rxjs'
export function log() {
return function logFn<T>(source: Observable<T>) {
const output = new Observable<T>((observer) => {
const subscription = source.subscribe({
next: (val) => {
console.log(val)
observer.next(val)
},