Skip to content

Instantly share code, notes, and snippets.

View mfal's full-sized avatar

Marco Falkenberg mfal

View GitHub Profile
type CollectionDiff<TModified, TNew = TModified, TDeleted = TModified> = {
new: TNew[];
modified: TModified[];
deleted: TDeleted[];
};
export const calcCollectionDiff = <L, R = L>(
left: Iterable<L> | Array<L>,
right: Iterable<R> | Array<R>,
getLeftKey: (item: L) => string,
<?php
namespace Mittwald\SpacesAuth\OAuth2;
use Mw\Spaces\OAuth2\EnvironmentOptions;
class ShopwareOptions extends EnvironmentOptions
{
public function getClientID()
{
return "spaces.de/oauth/cms/shopware/" . $this->getSpaceID();
@mfal
mfal / GreenBox.tsx
Last active January 25, 2024 12:25
Extend regular HTML Elements with React & TypeScript
// We extend from React.HTMLAttributes to get all the HTML attributes
// Don't extend React.HTMLProps!
export interface IGreenBoxProps extends React.HTMLAttributes<HTMLDivElement> {
title: string;
}
class GreenBox extends React.Component<IGreenBoxProps, void> {
public render() {
// If you don't spread children and title, the restProps
// still contain these props and compiler will say "no"
@mfal
mfal / deeper.sh
Created February 16, 2017 20:13
eval > docker > node >
#!/bin/sh
eval "$(docker run node:6-slim node -e "console.log('echo \"We must go deeper\"');")"