Skip to content

Instantly share code, notes, and snippets.

View kzelda's full-sized avatar
😄
الحمد لله

kzelda

😄
الحمد لله
View GitHub Profile
@kzelda
kzelda / FixWindowsBoot.md
Created February 17, 2020 07:49
Fix the MBR – Guide for Windows XP, Vista, 7, 8, 8.1, 10
@kzelda
kzelda / ReadWriteExcel.cs
Last active March 26, 2024 10:27 — forked from ram-sagar-mourya/ReadWriteExcel.cs
Read and Write Excel using open xml in c#
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ReadWriteExcelUsingOpenXml.Shared
@kzelda
kzelda / PS_SHRINK_ALL_USER_DATABASES.sql
Last active December 27, 2017 10:51
SQLServer ~ Shrink all user databases
USE master
GO
/*
EXEC PS_SHRINK_ALL_USER_DATABASES
*/
IF EXISTS(SELECT TOP 1 1 FROM sys.procedures WHERE name = 'PS_SHRINK_ALL_USER_DATABASES')
@ram-sagar-mourya
ram-sagar-mourya / ReadWriteExcel.cs
Created August 3, 2017 14:42
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>();
@samueljseay
samueljseay / es6-import-cheat-sheet.md
Created June 2, 2017 02:35
ES6 exports / imports cheat sheet
// default exports
export default 42;
export default {};
export default [];
export default (1 + 2);
export default foo;
export default function () {}
export default class {}
export default function foo () {}
@kzelda
kzelda / curl.md
Created November 13, 2016 09:53 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@nepsilon
nepsilon / git-change-commit-messages.md
Last active June 2, 2024 23:31
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

Git Cheat Sheet

Commands

Getting Started

git init

or

@hofmannsven
hofmannsven / README.md
Last active July 16, 2024 01:30
Git CLI Cheatsheet
@bdcravens
bdcravens / add-timestamps.sql
Created December 19, 2012 21:32
SQL Server - add createdAt and updatedAt columns, automatically updates
ALTER TABLE myTable
add createdAt datetime
CONSTRAINT DF_myTable_createdat DEFAULT GETDATE()
ALTER TABLE myTable
add updatedAt datetime
CONSTRAINT DF_myTable_updatedAt DEFAULT GETDATE()
go