Skip to content

Instantly share code, notes, and snippets.

@gtechsltn
gtechsltn / autopgsqlbackup
Created Sep 28, 2021 — forked from denishpatel/autopgsqlbackup
Auto PostgreSQL backup script.
View autopgsqlbackup
#!/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 Sep 28, 2021 — forked from matthewlehner/autopgsqlbackup
Auto PostgreSQL backup script.
View autopgsqlbackup
#!/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 / file_input_button.css
Created Aug 30, 2021 — forked from leompeters/file_input_button.css
File input button component problem...Whipping File Inputs Into Shape with Bootstrap 3...
View file_input_button.css
.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 / bootstrap-fileinput.js
Created Aug 30, 2021 — forked from ramsey/bootstrap-fileinput.js
Nicer looking file inputs for Bootstrap 3
View bootstrap-fileinput.js
/**
* 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) {
View Blog-UnixEpochTimeToDateTimeJsonConverterTests.md
using System;
using System.Text.Json;
using NUnit.Framework;

// ...

public class TestEntity
{
    [JsonPropertyName("datetime")]
@gtechsltn
gtechsltn / AppendImageExtension.cs
Created Aug 24, 2021 — forked from ChuckSavage/AppendImageExtension.cs
C# Is file an image and get its type
View AppendImageExtension.cs
// 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
{
@gtechsltn
gtechsltn / ReadWriteExcel.cs
Created Aug 22, 2021 — forked from kzelda/ReadWriteExcel.cs
Read and Write Excel using open xml in c#
View ReadWriteExcel.cs
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>();