Skip to content

Instantly share code, notes, and snippets.

View minhhungit's full-sized avatar
😘
Hello world

Jin minhhungit

😘
Hello world
View GitHub Profile
@minhhungit
minhhungit / Find SHRINK sessions with lock info.sql
Created August 15, 2021 06:20 — forked from EitanBlumin/Find SHRINK sessions with lock info.sql
SQL queries to troubleshoot a long-running DBCC SHRINK operation
/*
Author: Eitan Blumin | https://www.eitanblumin.com
Create Date: 2020-03-18
Last Update: 2020-06-22
Description:
This script will detect currently running sessions in your database which are running DBCC SHRINK commands.
It will also output the name of any tables and indexes the session is currently locking.
Use this query to find out what causes a SHRINK to run for too long.
You may need to run it multiple times to "catch" the relevant info.
@minhhungit
minhhungit / Shrink_Database_File_in_Specified_Increments.sql
Created August 15, 2021 06:19 — forked from EitanBlumin/Shrink_Database_File_in_Specified_Increments.sql
Shrink a database file in specified increments down to a specific size or percentage of used space
/*
----------------------------------------------------------------------------
Shrink a Database File in Specified Increments
----------------------------------------------------------------------------
Author: Eitan Blumin (t: @EitanBlumin | b: eitanblumin.com)
Creation Date: 2020-01-05
Last Update: 2020-08-23
----------------------------------------------------------------------------
Description:
This script uses small intervals to shrink a file (in the current database)
@minhhungit
minhhungit / J.HelpPopover.ts
Last active August 10, 2020 17:00
bootstrap-popover-with-serenity-form
/* Modules/Common/Helpers/J.HelpPopover.ts */
//===================================================
// Copyright @ 2020
// Author : Hung Vo ([email protected])
// Time : 2020, August 06
// Description : HelpPopover
//===================================================
namespace J {
@minhhungit
minhhungit / J.ToolDropdownButton.ts
Last active August 10, 2020 12:03
serenity-toolbar-dropdown-button
//===================================================
// Copyright @ 2020
// Author : Hung Vo ([email protected])
// Time : 2020, June 10
// Description : ToolDropdownButton
//===================================================
namespace J {
export interface ToolDropdownButtonOptions {
title?: string;
cssClass?: string;
static ushort GetShardId(string key)
{
using var md5 = MD5.Create();
{
var hash = md5.ComputeHash(Encoding.UTF8.GetBytes(key));
var integer = BigInteger.Abs(new BigInteger(hash));
return (ushort)(integer % ushort.MaxValue);
}
}
@minhhungit
minhhungit / 101-rx-samples.md
Created December 28, 2019 13:31 — forked from omnibs/101-rx-samples.md
101 Rx Samples in C#

101 Rx Samples in C#

This was taken from http://rxwiki.wikidot.com/101samples, because I wanted to be able to read it more comfortable with syntax highlighting.

Here's the unedited original, translated to Github Markdown glory:

101 Rx Samples - a work in progress

@minhhungit
minhhungit / Dialog.ts
Created October 17, 2019 02:14
lookupeditor: pass parameters and change lookupkey
constructor() {
super();
this.form.MyOption.change(e => {
let currentValue = Serenity.EditorUtils.getValue(this.form.MyOption);
//let currentText = Serenity.EnumFormatter.format(MyEnum, Q.toId(currentValue));
//Q.notifySuccess(`You selected ${currentText}, lookup items will be reloaded`);
// clear old value
namespace [YOUR_NAME_SPACE].Common {
export class MySliderRevealOptions {
initDialog: () => Serenity.EntityDialog<any, any>;
onDataChangeCallback?: () => void;
sliderWidth?: any;
entityOrId?: any;
// if we want to show next/previous buttons on slider
// then we also need to include grid data
.s-Form label.caption {
margin-bottom: 2px;
text-align: left;
flex-basis: 100%;
}
.flex-layout .field {
flex-wrap: wrap;
}
namespace YOUR_NAMESPACE.Common {
export class MySlilerRevealOptions {
target: JQuery;
initDialog: () => Serenity.EntityDialog<any, any>;
onDataChangeCallback?: () => void;
sliderWidth?: any;
entityOrId: any;
}