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 / GoDaddySSLHAProxy.md
Created January 28, 2023 10:57 — forked from sethwebster/GoDaddySSLHAProxy.md
Creating a PEM for HaProxy from GoDaddy SSL Certificate

GoDaddy SSL Certificates PEM Creation for HaProxy (Ubuntu 14.04)

1 Acquire your SSL Certificate

Generate your CSR This generates a unique private key, skip this if you already have one.

sudo openssl genrsa -out  etc/ssl/yourdomain.com/yourdomain.com.key 1024

Next generate your CSR (Certificate Signing Request), required by GoDaddy:

@minhhungit
minhhungit / CloudflareHttpHandler.cs
Created January 19, 2023 00:44 — forked from xHeaven/CloudflareHttpHandler.cs
Cloudflare http handler in C# allows scraping cloudflare protected websites
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using Microsoft.ClearScript.V8;
@minhhungit
minhhungit / RedisJobQueue.cs
Created December 8, 2022 14:44 — forked from tenowg/RedisJobQueue.cs
A Message/Job Queue based on StackExchange.Redis and Redis Server
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using StackExchange.Redis;
namespace CitySurvival.Redis
{
@minhhungit
minhhungit / BitSet.cs
Created September 1, 2021 05:25 — forked from NightOwl888/BitSet.cs
C# port of the java.util.BitSet class
/* BitSet.cs -- A vector of bits.
Copyright (C) 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
@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 (it.minhhung@gmail.com)
// 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 (it.minhhung@gmail.com)
// 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