Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
I may be slow to respond.

Martin Zlámal mrtnzlml

🐢
I may be slow to respond.
View GitHub Profile
@mrtnzlml
mrtnzlml / store-with-id.json
Created Feb 6, 2020
Internal structure of Relay store. Notice the difference for "AllHotelAvailabilityHotel" type. First JSON is an example of AllHotelAvailabilityHotel WITH GraphQL ID and second JSON shows how is it being stored when such ID doesn't exist.
View store-with-id.json
{
"client:root": {
"__id": "client:root",
"__typename": "__Root",
"allAvailableBookingComHotels(search:{\"checkin\":\"2020-02-13\",\"checkout\":\"2020-02-15\",\"cityId\":\"SG90ZWxDaXR5Oi0zNzI0OTA=\",\"roomsConfiguration\":[{\"adultsCount\":2}]})": {
"__ref": "client:root:allAvailableBookingComHotels(search:{\"checkin\":\"2020-02-13\",\"checkout\":\"2020-02-15\",\"cityId\":\"SG90ZWxDaXR5Oi0zNzI0OTA=\",\"roomsConfiguration\":[{\"adultsCount\":2}]})"
}
},
"client:root:allAvailableBookingComHotels(search:{\"checkin\":\"2020-02-13\",\"checkout\":\"2020-02-15\",\"cityId\":\"SG90ZWxDaXR5Oi0zNzI0OTA=\",\"roomsConfiguration\":[{\"adultsCount\":2}]})": {
"__id": "client:root:allAvailableBookingComHotels(search:{\"checkin\":\"2020-02-13\",\"checkout\":\"2020-02-15\",\"cityId\":\"SG90ZWxDaXR5Oi0zNzI0OTA=\",\"roomsConfiguration\":[{\"adultsCount\":2}]})",
View poem.txt
Once upon a time,
you join a company and you have to rhyme.
This story begins at the end of last year,
when I was in Mexico and changing career.
Pipedrive seemed to be quite a good choice,
but I also had to hear my internal voice.
Should I go or should I stay,
@mrtnzlml
mrtnzlml / cmdParser.js
Created Oct 24, 2019
WIP (well, abandoned)
View cmdParser.js
// @flow strict
function terminate(help, error) {
console.error('%s\n\n%s', help, error);
process.exit(1);
}
/**
* Goal of this parser is to create less awkward tool for working with command line. You just
* have to write a help screen and the rest is responsibility of this parser.
@mrtnzlml
mrtnzlml / slack.js
Created Sep 30, 2019
Downloading Slack emojis
View slack.js
import fs from 'fs';
import path from 'path';
import fetch from '@kiwicom/fetch';
// See: https://gist.github.com/lmarkus/8722f56baf8c47045621
import { emoji } from './emoji.json';
(async function() {
for (const [name, link] of Object.entries(emoji)) {
const downloadLink = link;
@mrtnzlml
mrtnzlml / notes.md
Created Aug 16, 2019
Facebook monorepo reverse engineering
View notes.md
fbandroid/first-party/java/androidsdk/
fbandroid/libraries/soloader/
fbandroid/libraries/textlayoutbuilder/
fbandroid/xplat/yoga/BUCK							# xplat ??

fbobjc/EndToEndTests/WebDriverAgent/src/
fbobjc/VendorLib/IGListKit/src/					# Instagram
fbobjc/VendorLib/ComponentKit/src/
fbobjc/ios-sdk/AccountKit/samples/
View stableStringify.js
// @flow strict
import isObject from './isObject';
// Inspiration (modified and fixed stability):
// https://github.com/facebook/relay/blob/87930e12ed9694865d3a70dda564c0711e2890fd/packages/relay-runtime/util/stableCopy.js
/**
* @see http://www.ecma-international.org/ecma-262/6.0/#sec-sortcompare
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
@mrtnzlml
mrtnzlml / graphql-1.txt
Last active May 1, 2019
GraphQL Summit 2017 in San Francisco
View graphql-1.txt
GraphQL at massive scale
- IBM cloud = node micro services (30+ teams) - separate codebases
- frontend need to fetch data from multiple endpoints (bad documentation) - it’s a inconsistent mess
- graphql centralize this - grapnel microservice (single endpoint), documentation included
- data sources (schema + resolvers + model + connector) = plugin (independent GitHub repo)
- GrAMPS Middleware (schema stitching)
- extended error messages (GUID, documentation links
- datasource starter kit (strong starting point for new data sources)
- GitHub: grapms-graphql/gramps-express (based on Apollo server) - MIT licence - GraphQL Apollo Microservice Patterns Server
View keybase.md

Keybase proof

I hereby claim:

  • I am mrtnzlml on github.
  • I am mrtnzlml (https://keybase.io/mrtnzlml) on keybase.
  • I have a public key ASADGpO1TWE5EpWhUVa2Mpr6qLDYCh9PULMZRU-z9ICW7wo

To claim this, I am signing this object:

You can’t perform that action at this time.