Skip to content

Instantly share code, notes, and snippets.

Avatar
😄
Hoi!

Martijn Hols MartijnHols

😄
Hoi!
  • MartijnHols
  • The Netherlands
View GitHub Profile
@MartijnHols
MartijnHols / useDocumentHeight.ts
Created May 31, 2021
React hooks for getting the document height that updates when the On Screen Keyboard/Virtual Keyboard toggles
View useDocumentHeight.ts
import { useCallback, useEffect, useState } from 'react'
const useDocumentHeight = () => {
const getHeight = useCallback(
() =>
window.visualViewport ? window.visualViewport.height : window.innerHeight,
[],
)
const [height, setHeight] = useState<number>(getHeight())
@MartijnHols
MartijnHols / README.md
Last active Jan 11, 2020
GraphQL queries over a websocket in Node.js (with TypeScript)
View README.md

GraphQL over websockets doesn't seem to be widely used yet. There are several libraries, articles and docs available but half of them don't work, require additional new technologies or provide non-standard solutions. I tried to find a simple, reliable and scalable solution that didn't need much more knowledge outside of Apollo, GraphQL and WebSockets. I also don't want it to rely on unrelated libraries like Express so I don't lock myself in. It will probably also benefit the server structure to keep Apollo separate from other modules (sort of like a microservice).

Using apollo-server (while not very performant) seems to be one of the few proven technologies for having a GraphQL backend in Node.js. Using that on the server is probably going to provide the quickest road to production, as it's widely used it will probably have decent documentation and issues can probably be solved by a few Google queries. I

@MartijnHols
MartijnHols / opinion.md
Last active Mar 9, 2018
BFA class changes opinion
View opinion.md

Hi, I am Martijn aka Zerotorescue. For the past year or so I've been theorycrafting about mainly Holy Paladins. This started with a bunch of spreadsheets to analyze and value elements of the spec such as special items, legendaries, talents, and mana's value. To analyze things not previous possible I made the Holy Paladin Mastery Effectiveness Calculator tool which has since grown into the WoWAnalyzer platform that is available today.

There haven't been a lot of changes to Holy Paladins this early into the alpha, and I haven't seen any indication that there will even be any major changes to the spec at all. I don't have access to the alpha so I haven't been able to do any in-game testing yet.

There were a few new things known that are worth mentioning:

  • The mana cost of Cleanse was reduced by 50%. This is actually pretty helpful and will make dispell-intensive fights a lot less painful as it was as expensive as our most e
View oldCooldownUsable.test.js
import SPELLS from 'common/SPELLS';
import CooldownUsable from './CooldownUsable';
describe('Core/Modules/CooldownUsable', () => {
let instance;
let combatantsMock;
let castEfficiencyMock;
let hasteMock;
beforeEach(() => {