Skip to content

Instantly share code, notes, and snippets.

import {
Component,
ChangeDetectionStrategy,
NgModule,
Input,
} from '@angular/core';
import { Observable } from 'rxjs';
import { WithObservableModule } from '.';
@Component({
export interface StringBasedIndexedEntry {
id: string;
}
export interface NumberBasedIndexedEntry {
id: number;
}
type AnyIndexedEntry = StringBasedIndexedEntry | NumberBasedIndexedEntry;
@mynameislau
mynameislau / linux.sh
Last active September 22, 2020 14:39
Linux stuff
#list infos about system
cat /etc/*release
#disk usage simple :
du -h --max-depth=1 .
# commits ahead commits behind
git rev-list --left-right --count origin/rc...(git rev-parse --abbrev-ref HEAD)
#rm docker volumes matching regex pattern :
Object.defineProperty(window, 'localStorage', {
configurable: true,
enumerable: true,
value: new Proxy(localStorage, {
set: function (ls, prop, value) {
console.log(`direct assignment: ${prop} = ${value}`);
debugger;
ls[prop] = value;
return true;
},
\Doctrine\Common\Util\Debug::dump($var, $maxDepth = 2, $stripTags = false, $echo = true)
php /usr/local/bin/composer.phar
<img src={{ file_url(content.field_image|field_target_entity.uri.value) }} alt={{ content.field_image|field_raw('alt') }} />
@mynameislau
mynameislau / youtube.html
Created April 10, 2018 11:49
Youtube Fluid
<f:if condition="{mediaElement.originalResource.type} == 4 && {mediaElement.originalResource.properties.extension} == 'youtube'} == 'youtube'">
<f:then>
<v:media.youtube videoId="{mediaElement.originalResource.contents}" width="500" height="500" autoplay="0" legacyCode="0" showRelated="0" extendedPrivacy="1"
hideControl="1" hideInfo="1" enableJsApi="1" loop="0" lightTheme="1" />
</f:then>
<div>
{truc -> f:format.raw()}
</div>
<!-- outputs : <div><p>Toto</p><div> -->
<img.*?[^-]src(set)?=".*?.(jpg|png).*?".*?(>|\n)
[...]
type mainData = {
gActions: list(gAction),
entities: list(entity),
history: list(historyChunk),
resources: int
};
@mynameislau
mynameislau / FileA.re
Created February 17, 2018 16:27
Circular dependency ReasonML
type foo = {
bla: string
};
type bar = {
fooList: list(foo)
};
let theBar = {
fooList: [