Skip to content

Instantly share code, notes, and snippets.

View ntxinh's full-sized avatar
💭
❤️ .NET & JavaScript

Xinh Nguyen ntxinh

💭
❤️ .NET & JavaScript
View GitHub Profile
@ntxinh
ntxinh / main.gs
Created July 11, 2025 14:10 — forked from huythai855/main.gs
GScript to check uptime/downtime of a website, then send email to subscribers.
function init() {
if (ScriptApp.getProjectTriggers().length == 0) {
ScriptApp.newTrigger("websiteMonitor").timeBased().everyMinutes(0.1).create();
}
}
function websiteMonitor() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Config");
var lastRow = sheet.getLastRow();
Logger.log('last'+lastRow);
@ntxinh
ntxinh / FluentValidationAlternative.cs
Created January 8, 2024 09:42 — forked from olivier5741/FluentValidationAlternative.cs
An alternative library API to FluentValidation
namespace Validation.Tests
{
using System;
using System.Collections.Generic;
using Xunit;
public class User
{
public string Name { get; set; }
public int Age { get; set; }
@ntxinh
ntxinh / unsaved-changes-guard.ts
Created October 3, 2019 04:41 — forked from Splaktar/unsaved-changes-guard.ts
Guard against navigating away when there are unsaved changes
import {CanDeactivate, Router} from '@angular/router';
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs/Observable';
import {Observer} from 'rxjs/Observer';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
export interface CanComponentDeactivate {
canDeactivate: () => Observable<boolean> | Promise<boolean> | boolean;
}