Skip to content

Instantly share code, notes, and snippets.

View elierotenberg's full-sized avatar

Elie Rotenberg elierotenberg

View GitHub Profile
@elierotenberg
elierotenberg / README.md
Last active January 11, 2020 09:50
Offline password generator bookmarklet

Notes:

  • password generation is purely offline; no risk of mitm
  • uses browser crypto API if available; fallback to Math.random
  1. Copy and paste the following URL in your browser address bar:
@elierotenberg
elierotenberg / snippet.js
Created April 6, 2020 20:19
Move Netflix subtitles to top
(() => {
const css = `
.player-timedtext > div {
position: static !important;
text-align: center !important;
}
`;
const style = document.createElement("style");
style.innerHTML = css;
@elierotenberg
elierotenberg / Maybe.ts
Last active March 5, 2024 12:37
Maybe with fallback
export const isNonNullable = <T>(value: T): value is NonNullable<T> =>
typeof value !== `undefined` && value != null;
export class Maybe<T> {
private readonly value: T;
private readonly notFoundMessage: string;
public constructor(value: T, notFoundMessage: string) {
this.value = value;
this.notFoundMessage = notFoundMessage;
@elierotenberg
elierotenberg / keybindings.json
Created March 6, 2024 08:50
VSCode restart TS / ESlint / GraphQL
[
{
"args": {
"commands": [
"eslint.restart",
"typescript.restartTsServer",
"vscode-graphql.restart"
]
},
"command": "runCommands",