This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generates a simple Calendar formatted as an array of arrays | |
* @param year Year for which calendar month is generated | |
* @param month Calendar month to be generated | |
* @param startWeekMonday Optional offset -- defaults to false (week starts on Sunday) | |
* @returns Main array (month) of arrays (weeks) of days | |
* @see Based on algorithm by github:lukeed/calendarize | |
*/ | |
private generateMonthCalendar(year: number, month: number, startWeekMonday = false) { | |
const res: number[][] = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ ... }) | |
export class Mva10SelectFieldComponent { | |
constructor( private elementRef: ElementRef ) { } | |
onClickOut(targetElement?: HTMLElement): void { | |
if (!targetElement) { return; } | |
const clickedInside = this.elementRef.nativeElement.contains(targetElement); | |
if (!clickedInside) { | |
// Clicked outside component! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --aot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT JSON_PRETTY(JSON_ARRAYAGG( | |
JSON_OBJECT('code', code, 'name', name, 'iso3', iso3, 'numcode', numcode, 'city', city) | |
)) FROM country; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class InteractiveViewerOverlay extends StatefulWidget { | |
final Widget child; | |
final double maxScale; | |
const InteractiveViewerOverlay({ | |
Key key, | |
@required this.child, | |
this.maxScale, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
const totalColorsToShow = 50; | |
const startColor = Colors.red; | |
const finalColor = Colors.green; | |
class MyApp extends StatelessWidget { | |
@override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Windows debloater by https://github.com/Sycnex/Windows10Debloater | |
iwr -useb https://git.io/debloat|iex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Located in /.well-known directory, next to a apple-app-site-association.json file | |
RewriteEngine On | |
RewriteBase /.well-known/ | |
RewriteRule ^apple-app-site-association$ apple-app-site-association.json [NC,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Originally by Simon Lightfoot | |
extension WhenAsyncSnapshot<T> on AsyncSnapshot<T> { | |
R when<R>({ | |
R Function()? empty, | |
R Function(dynamic error, StackTrace? stackTrace)? error, | |
R Function()? loading, | |
R Function(T value)? data, | |
}) { | |
if (hasData && data != null) // If we have data then lets display it no-matter what! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
template: ` | |
<div *ngIf="data$ | async as data"> | |
{{ data }} | |
</div> | |
` | |
}) | |
export class SearchComponent implements OnInit { | |
private dataService = inject(DataService); |