Skip to content

Instantly share code, notes, and snippets.

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

kzelda

😄
الحمد لله
View GitHub Profile
@kzelda
kzelda / elbilad.net.monkey.user.js
Created September 5, 2016 13:18 — forked from boubkhaled/elbilad.net.monkey.user.js
Enable text selection
// ==UserScript==
// @name elbilad.net
// @namespace MyScripts
// @description Autoriser la sélection du text
// @include http://www.elbilad.net/*
// @version 1
// @grant none
// ==/UserScript==
$("#contenu *").css("-moz-user-select","text");
@kzelda
kzelda / README.md
Created November 13, 2016 09:39 — forked from joyrexus/README.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@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
@kzelda
kzelda / add-timestamps.sql
Created December 24, 2017 09:40 — forked from bdcravens/add-timestamps.sql
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
@kzelda
kzelda / 1_primitive_comparison.js
Created February 12, 2018 14:57 — forked from nicbell/1_primitive_comparison.js
JavaScript object deep comparison. Comparing x === y, where x and y are values, return true or false. Comparing x === y, where x and y are objects, returns true if x and y refer to the same object. Otherwise, returns false even if the objects appear identical. Here is a solution to check if two objects are the same.
//Primitive Type Comparison
var a = 1;
var b = 1;
var c = a;
console.log(a == b); //true
console.log(a === b); //true
console.log(a == c); //true
console.log(a === c); //true
@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
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Spreadsheet;
using System.Linq;
namespace ExcelHelper
{
public static class ExcelHelper
{
public static WorksheetPart GetWorksheetPartByName(SpreadsheetDocument document, string sheetName)
@kzelda
kzelda / active.md
Created August 20, 2018 14:32 — forked from paulmillr/active.md
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Tue, 06 Dec 2016 17:06:46 GMT till Wed, 06 Dec 2017 17:06:46 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user => user.followers > 1000)
@kzelda
kzelda / gist:4fc3d3ac37f4b53a29c14f022cc6b3d7
Created September 24, 2019 10:53 — forked from leggetter/gist:769688
How to get the body of a HTTP Request using C#
private string GetDocumentContents(System.Web.HttpRequestBase Request)
{
string documentContents;
using (Stream receiveStream = Request.InputStream)
{
using (StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8))
{
documentContents = readStream.ReadToEnd();
}
}
@kzelda
kzelda / version_compare.js
Created October 6, 2019 13:40 — forked from TheDistantSea/version_compare.js
Function to compare two version strings (e.g. "1.6.1" is smaller than "1.7"). Developed in order to answer http://stackoverflow.com/a/6832721/50079.
/**
* Compares two software version numbers (e.g. "1.7.1" or "1.2b").
*
* This function was born in http://stackoverflow.com/a/6832721.
*
* @param {string} v1 The first version to be compared.
* @param {string} v2 The second version to be compared.
* @param {object} [options] Optional flags that affect comparison behavior:
* <ul>
* <li>