Skip to content

Instantly share code, notes, and snippets.

View zeusdeux's full-sized avatar
👾
i wear my sunglasses at night so i can — so i can justify the money spent on 'em

Mudit zeusdeux

👾
i wear my sunglasses at night so i can — so i can justify the money spent on 'em
View GitHub Profile
@zeusdeux
zeusdeux / tatiana-mac-speaker-rider.md
Created October 29, 2019 15:57 — forked from tatianamac/tatiana-mac-speaker-rider.md
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Before I'll agree to a speaking event, I try to do as much research I can around the event to ensure it aligns with my ethos. I want to share this in case it's helpful to any other speakers.

👐 Speaking comes with immense privilege. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most marginalised and suppressed communities.

😫 I wish I didn't have to, but this is long because I provide a lot of explanations for those of you who never had to consider these things. And I will be honest, most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

1️⃣ All of these are based on my own ethos. I don't wish to or attempt to speak on behalf of all conference speake

Reach UI Philosophy

Reach UI is an accessible foundation for React applications and design systems.

The three equally important goals are to be:

  • Accessible
  • Composable
  • Stylable
@zeusdeux
zeusdeux / boop.js
Created August 30, 2019 12:12
How to cress?
import React from 'react'
import { Cress } from './path/to/Cress.js';
// looks like dead-code right?
new Cress('.my-selector', {
css() {
return `
this {
font-family: cursive;
}
@zeusdeux
zeusdeux / jwtRS256.sh
Created August 23, 2019 14:25 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@zeusdeux
zeusdeux / .eslintrc.js
Created July 26, 2019 14:04
eslint override ordering example
module.exports = {
...
overrides: [
{
files: ['src/**/*.js'],
rules: {
'some-rule': 'error',
'some-other-rule': 'error'
}
},
@zeusdeux
zeusdeux / Either.ts
Last active February 19, 2024 19:20
Another Maybe and Either implementation in Typescript without making the value constructors (Just, Nothing, Left and Right) types themeselves as in the previous attempt
// Either monad using discriminated unions
export type Either<L, R> =
| { type: "left"; value: L }
| { type: "right"; value: R };
export function Left<L, R>(a: L): Either<L, R> {
return {
type: "left",
value: a
};
@zeusdeux
zeusdeux / have_i_been_pwned.sh
Last active June 7, 2023 08:08
Check if any passwords have been compromised using HIBP's password API (https://haveibeenpwned.com/API/v2#PwnedPasswords). Your password never leaves your local system!
#!/usr/bin/env bash
# enable when debugging
# set -o errexit
# set -o errtrace
# set -o xtrace
# set -o nounset
# set -o pipefail
plsno () {
@zeusdeux
zeusdeux / sumTypesWithNever.ts
Created January 5, 2019 17:39
Sum types with never in typescript
// never is dropped from sum types
let x: string | never // string
let y: Exclude<'a' | 'b', 'b'> // y has the type 'a'
/*
* Explanation:
* Given that Exclude is defined as: type Exclude<T, U> = T extends U ? never : T
* Exclude<'a' | 'b', 'b'> checks if 'a' extends 'b'.
* It doesn't and hence 'a' is returned
* Type system then checks if 'b' extends 'b'.
@zeusdeux
zeusdeux / transaction.js
Created November 20, 2018 10:14
Simple transaction in js
/**
* @description
* Returns a transaction object which is composed of operations.
* The transaction resolves only when all operations it is made of succeed.
* If any operation fails, it reverts ALL operations and rejects the transaction.
* If any of the reverts also fail, then it rejects the transaction as well
* with an error that can help the developer manually make data consistent.
*
* @param {function} transaction - A function that builds operations and calls run on them
*
@zeusdeux
zeusdeux / Either.ts
Created September 4, 2018 08:54
Either monad in typescript
export type Either<L,R> = Left<L> | Right<R>
export class Left<L> {
constructor(private readonly value: L) {}
public getValue() {
return this.value
}
}
export class Right<R> {