Skip to content

Instantly share code, notes, and snippets.

View mrtnzlml's full-sized avatar
🐢
I may be slow to respond.

Martin Zlámal mrtnzlml

🐢
I may be slow to respond.
View GitHub Profile
@klaaspieter
klaaspieter / ASS.md
Created June 22, 2017 07:59 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@miyaokamarina
miyaokamarina / conditions.js
Last active March 9, 2023 15:31
Type-level conditions in Flow https://is.gd/OPsJBd
// Licensed under CC BY 4.0.
type $If<X: boolean, Then, Else = empty> = $Call<
& ((true, Then, Else) => Then)
& ((false, Then, Else) => Else),
X,
Then,
Else,
>;
git archive --format=zip HEAD `git diff HEAD~1..HEAD --name-only --diff-filter=d | grep -E 'config/locales/.+\.yml|frontend/translations/.+\.js'` > files-changed-to-translate.zip
// change 1 to number of commits in pr
@Manishearth
Manishearth / hodor.rs
Last active January 1, 2023 00:34
yo dawg
#![recursion_limit = "300000"]
type CellType = u8;
const MEM_SIZE: usize = 30_000;
macro_rules! Hodor_impl {
/*
# Loop Extraction
@faruken
faruken / s3arangodb.sh
Created July 21, 2017 04:14
backup arangodb to S3
#!/bin/sh
# Slightly modified to meet ArangoDB's needs. https://github.com/lumerit/s3-shell-backups
NOWDATE=`date +%Y-%m-%d`
LASTDATE=$(date +%Y-%m-%d --date='1 week ago')
USERNAME="${ARANGODB_USERNAME}"
PASSWORD="${ARANGODB_PASSWORD}"
DATABASE='dbname'
@robrichard
robrichard / defer-array.md
Last active February 25, 2020 07:59
Relay Compatible `@defer` & `@stream`

Using @defer under an array field will return multiple patches. Patches are unique combinations of label and path

{
  items {
    id
    ...frag @defer(label: "my-label")
  }
}
/*
A collection of tests where Flow and TypeScript might have different behavior
Some tests are borrowed from https://github.com/vkurchatkin/typescript-vs-flow
Some tests now have the same behavior as the new versions of Flow/TS have fixed the bugs and improved type safety
*/
/* 1. Accessing unknown properties on objects */
@sibelius
sibelius / MutationUtils.js
Created March 19, 2018 10:20
Helper methods for Relay Modern updater
// @flow
import { ConnectionHandler } from 'relay-runtime';
import { isObject, isArray } from 'lodash/fp';
export function listRecordRemoveUpdater({ parentId, itemId, parentFieldName, store }) {
const parentProxy = store.get(parentId);
const items = parentProxy.getLinkedRecords(parentFieldName);
parentProxy.setLinkedRecords(items.filter(record => record._dataID !== itemId), parentFieldName);
}