Skip to content

Instantly share code, notes, and snippets.

View gtechsltn's full-sized avatar
🍊

Nguyen Viet Manh gtechsltn

🍊
View GitHub Profile
@gtechsltn
gtechsltn / ReadWriteExcel.cs
Created August 22, 2021 14:44 — forked from kzelda/ReadWriteExcel.cs
Read and Write Excel using open xml in c#
private DataTable ReadExcelSheet(string fname, bool firstRowIsHeader)
{
List<string> Headers = new List<string>();
DataTable dt = new DataTable();
using (SpreadsheetDocument doc = SpreadsheetDocument.Open(fname, false))
{
//Read the first Sheets
Sheet sheet = doc.WorkbookPart.Workbook.Sheets.GetFirstChild<Sheet>();
Worksheet worksheet = (doc.WorkbookPart.GetPartById(sheet.Id.Value) as WorksheetPart).Worksheet;
IEnumerable<Row> rows = worksheet.GetFirstChild<SheetData>().Descendants<Row>();
@gtechsltn
gtechsltn / AppendImageExtension.cs
Created August 24, 2021 04:54 — forked from ChuckSavage/AppendImageExtension.cs
C# Is file an image and get its type
// Includes a mini-program for checking and fixing files that have no extension
// Only checks for the most common types
// If you create a better version, please upload it here.
using System;
using System.Collections.Generic;
using System.IO;
namespace AppendJPG
{
using System;
using System.Text.Json;
using NUnit.Framework;

// ...

public class TestEntity
{
    [JsonPropertyName("datetime")]
@gtechsltn
gtechsltn / bootstrap-fileinput.js
Created August 30, 2021 02:04 — forked from ramsey/bootstrap-fileinput.js
Nicer looking file inputs for Bootstrap 3
/**
* Nicer looking file inputs for bootstrap 3
* By Jeff Dairiki <dairiki@dairiki.org> based on ideas from
* http://www.abeautifulsite.net/blog/2013/08/whipping-file-inputs-into-shape-with-bootstrap-3/
*
* Found here: http://jsbin.com/OxOQoDa/8
*/
(function ($) {
var Upload = function (element, options) {
@gtechsltn
gtechsltn / file_input_button.css
Created August 30, 2021 02:05 — forked from leompeters/file_input_button.css
File input button component problem...Whipping File Inputs Into Shape with Bootstrap 3...
.btn-file {
position: relative;
overflow: hidden;
}
.btn-file input[type=file] {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
min-height: 100%;
@gtechsltn
gtechsltn / autopgsqlbackup
Created September 28, 2021 02:18 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@gtechsltn
gtechsltn / autopgsqlbackup
Created September 28, 2021 02:18 — forked from denishpatel/autopgsqlbackup
Auto PostgreSQL backup script.
#!/bin/bash
#
# PostgreSQL Backup Script Ver 1.0
# http://autopgsqlbackup.frozenpc.net
# Copyright (c) 2005 Aaron Axelsen <axelseaa@amadmax.com>
#
# This script is based of the AutoMySQLBackup Script Ver 2.2
# It can be found at http://sourceforge.net/projects/automysqlbackup/
#
# The PostgreSQL changes are based on a patch agaisnt AutoMySQLBackup 1.9
@gtechsltn
gtechsltn / .NET6Migration.md
Created October 14, 2021 02:21 — forked from davidfowl/.NET6Migration.md
.NET 6 ASP.NET Core Migration
@gtechsltn
gtechsltn / MinimalAPIs.md
Created October 14, 2021 03:19 — forked from davidfowl/MinimalAPIs.md
Minimal APIs at a glance
@gtechsltn
gtechsltn / Concepts in .Net
Created March 27, 2022 04:22 — forked from akhilbhardwaj23/Concepts in .Net
Fundamentals concepts in C#, ASP.Net, WCF
var vs dynamic key word
multicast delegate, what happens if 3 methods returns 3 diff types
Binary search over lineasr search
Rest Services
WCF: logging client ip on server side without adding it from wcf client using message inspector
HTTP handler over .aspx files
Events fires in iis when hitting an aspx page
ThrEAD safe singleton
project architecture
design pattern used in ur project