Skip to content

Instantly share code, notes, and snippets.

Avatar

Jannik Hell jahe

View GitHub Profile
@jahe
jahe / web-application-best-practices.md
Last active Mar 21, 2021
Web Application - Best Practices
View web-application-best-practices.md
@jahe
jahe / graphql-cheatsheet.md
Last active Aug 4, 2020
GraphQL Cheatsheet
View graphql-cheatsheet.md

Essential quotes

  • "GraphQL is about asking for specific fields on objects"
  • "The query has exactly the same shape as the result"
  • "Clients can fetch lots of related data in one request, instead of making several roundtrips in a classic REST architecture"
  • "GraphQL queries look the same for both single items or lists of items"
  • "In REST, you can only pass a single set of arguments but in GraphQL, every field and nested object can get its own set of arguments, making GraphQL a complete replacement for making multiple API fetches"
  • "While query fields are executed in parallel, mutation fields run in series, one after the other"

Glossary

  • Type
@jahe
jahe / go-cheatsheet.go
Last active Jun 15, 2020
Go Cheatsheet
View go-cheatsheet.go
// Simple function
func add(x int, y int) int {
return x + y
}
// Function that returns 2 values
func swap(x string, y string) (string, string) {
return y, x
}
@jahe
jahe / typescript-cheatsheet.ts
Last active Mar 21, 2021
TypeScript Cheatsheet
View typescript-cheatsheet.ts
// Activate the family of strict options
// You can then selectively opt out with specific strict options set to false
--strict
// Properties in ES6 classes should be initialized
//
// It checks weather one of the following conditions evaluatest to true:
// * has a type that includes undefined
// * has an explicit initializer
// * is definitely assigned to in the constructor
View aws-ecs-cheatsheet.md

Container Definition within Task Definition

memory and memoryReservation - The memory setting is a hard limit. If the containers memory usage hits this amount, the container will be terminated. If on the other hand, you specify memoryReservation, that much memory will be reserved for the task, but it can use more, up to the total amount of the machine. Only one of memory and memoryReservation are required. If both are used, memoryReservation should be less than memory. If you are only going to specify one of these, I'd recommend memoryReservation, as it will allow your task to use up to the total memory on the machine.

@jahe
jahe / python-cheatsheet.py
Last active Jun 15, 2020
Python Cheatsheet
View python-cheatsheet.py
# All values are considered "truthy" except for the following, which are "falsy":
None
False
0
0.0
0j
Decimal(0)
Fraction(0, 1)
[] - an empty list
View svg-cheatsheet.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jahe
jahe / key-and-password-generation-cheatsheet.sh
Created Sep 27, 2018
Key / Password Generation Cheatsheet
View key-and-password-generation-cheatsheet.sh
# Generate a safe password with node.js
node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"
@jahe
jahe / resilient-software-design.md
Created Aug 18, 2018
Resilient Software Design
View resilient-software-design.md

Fehlerszenarien

  • Nutzer bekommt nichts davon mit (bester Fall)
  • Anwendung läuft in einem definierten, reduzierten Service-Level weiter

Ziele von Software, damit sie einen Geschäftswert erzielt

  • Muss in Produktion laufen
  • Muss ordnungsgemäß funktionieren (Verfügbarkeit)

Verfügbarkeit = MTTF / (MTTF + MTTR)

View iterm2-cheatsheet.sh
# Split vertically
⌘+D
# Split horizontally
⌘+Shift+D
# Navigate between panes
⌘+⌥+Arrow
# Toggle maximizing the current pane (full screen)