Skip to content

Instantly share code, notes, and snippets.

View Burgov's full-sized avatar

Bart van den Burg Burgov

View GitHub Profile
const t = new Date();
if (isPlatformBrowser(this.platformId)) {
const timeoutDelay = 60_000;
const events = ['keypress', 'click', 'wheel', 'mousemove', 'ontouchstart'];
const $onInactive = from(events.map(e => fromEvent(this.document, e))).pipe(
mergeAll(),
map(() => false),
timeout({ each: timeoutDelay, with: () => of(true) }),
repeat(),
@Component({
selector: 'content-component',
template: '<div>Test {{ data }}</div>',
})
export class ContentComponent {
@Input() data: string;
}
@Component({
selector: 'child-component',
@Component({
selector: 'parent-component',
template: '<child-component><content-component></content-component></child-component>'
})
export class ParentComponent implements AfterViewInit {
}
@Component({
selector: 'child-component',
template: '<button (click)="this.increaseContentCounter()"></button><ng-content></ng-content>'
@Component({
selector: 'parent-component',
template: '<child-component></child-component>'
})
export class ParentComponent implements AfterViewInit {
@ViewChild(ChildComponent) child!: ChildComponent;
protected myData = 'my data';
handleEvent(counter: number) {
@Component({
selector: 'parent-component',
template: '<child-component [myInput]="myData" (myOutput)="handleEvent($event)"></child-component>'
})
export class ParentComponent {
protected myData = 'my data';
handleEvent(counter: number) {
alert(counter);
}
import { promisify } from 'util';
import axios from 'axios';
const exec = promisify(require('child_process').exec);
async function run() {
const affected = [];
for (const project of ['api', 'frontend', 'functions']) {
console.error(`Project: ${project}`);
$ git diff
diff --git a/package.json b/package.json
index a1e396fb4..0514a26ee 100644
--- a/package.json
+++ b/package.json
@@ -45,20 +45,20 @@
"dependencies": {
"@angular-material-components/color-picker": "7.0.0",
"@angular-material-components/datetime-picker": "7.0.0",
- "@angular/animations": "13.0.2",
@Burgov
Burgov / fritsTracking.js
Last active August 31, 2021 12:42 — forked from stijnjanmaat/fritsTracking.js
Frits Tracking at Affiliate
// Managed by Frits
const init = () => {
let _handler = () => {}; // just an empty function in case no listener is registered.
setTimeout(() => {
_handler({ myEventData: 'something' });
}, 1000);
return {
onEvent: (handler) => { _handler = handler }
@Burgov
Burgov / input.scss
Created October 2, 2020 08:17
Generated by SassMeister.com.
img, video {
height: 200px;
:host-context(.desktop) & {
height: 300px;
}
}
:host-context(.desktop) {
img, video {
import * as imagepicker from 'nativescript-imagepicker';
import { ImagePickerMediaType } from 'nativescript-imagepicker';
import { EMPTY, Observable } from 'rxjs';
import { knownFolders } from 'tns-core-modules/file-system';
import { fromFile } from 'tns-core-modules/image-source';
import * as dialogs from 'tns-core-modules/ui/dialogs';
import * as utils from 'tns-core-modules/utils/utils';
export declare const NO_IMAGE_SELECTED = 'no-image-selected';