Skip to content

Instantly share code, notes, and snippets.

View GFoley83's full-sized avatar
☘️
CTO @ Educa

Gavin Foley GFoley83

☘️
CTO @ Educa
View GitHub Profile

By Alex Siepman

Converted to Markdown from http://www.siepman.nl/blog/post/2013/10/28/ID-Sequential-Guid-COMB-Vs-Int-Identity-using-Entity-Framework.aspx

Introduction

Recently i had to choose a type for an Id in a SQL server Database. We are using Entity framework to access the database. I had to choose between Guid an Int. I seems to me that Guid must be a slow solution but in a real world scenario, this was not true (see results later in this blog). First an (optional) small introduction about some terms used here. Then the testresult, folowwing by the C# implementation of a third option, called Sequential Guid.

@pascalnaber
pascalnaber / dev-resources.sh
Last active March 31, 2020 20:18
azure cli sample
KEYVAULT_NAME=donovankv
RESOURCEGROUP=donovan
MY_SECRET_VALUE=donovan
FUNCTIONAPP_STORAGEACCOUNT_NAME=donovanstore
LOCATION=westeurope
FUNCTIONAPP_NAME=donovanfa
. ./resources.sh
@arikfr
arikfr / README.md
Last active April 18, 2024 20:25
Setting up HTTPS with LetsEncrypt for Redash Docker Deployment
  1. Make sure the domain you picked points at the IP of your Redash server.
  2. Switch to the root user (sudo su).
  3. Create a folder named nginx in /opt/redash.
  4. Create in the nginx folder two additional folders: certs and certs-data.
  5. Create the file /opt/redash/nginx/nginx.conf and place the following in it: (replace example.redashapp.com with your domain name)
    upstream redash {
        server redash:5000;
    }
    
@mrgoos
mrgoos / app.module.ts
Last active May 27, 2022 19:42
Intercepting http request/respons in Angular 2. Works from version 2.3.0.
...
...
providers: [
{ provide: Http, useClass: ExtendedHttpService }
]
...
...
@JonCole
JonCole / Redis-BestPractices-General.md
Last active April 18, 2024 07:57
Redis Best Practices

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@vkostyukov
vkostyukov / statuses.md
Last active February 13, 2024 21:39
HTTP status codes used by world-famous APIs
API Status Codes
[Twitter][tw] 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504
[Stripe][stripe] 200, 400, 401, 402, 404, 429, 500, 502, 503, 504
[Github][gh] 200, 400, 422, 301, 302, 304, 307, 401, 403
[Pagerduty][pd] 200, 201, 204, 400, 401, 403, 404, 408, 500
[NewRelic Plugins][nr] 200, 400, 403, 404, 405, 413, 500, 502, 503, 503
[Etsy][etsy] 200, 201, 400, 403, 404, 500, 503
[Dropbox][db] 200, 400, 401, 403, 404, 405, 429, 503, 507
@andreasbotsikas
andreasbotsikas / Program.cs
Last active October 9, 2023 10:38
Move Azure blobs from one container to another
using System;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;
/// <summary>
/// Moves blobs from one container to another
/// Install-Package WindowsAzure.Storage
/// </summary>
namespace MoveBlobs
{
class Program
@dzimchuk
dzimchuk / gist:1e45174d3a63705b9171
Last active February 2, 2022 16:41
PowerShell script to copy Azure Table from one account to another
param (
[string]
$sourceConnectionString = $(throw "-sourceConnectionString is required."),
[string]
$sourceTableName = $(throw "-sourceConnectionString is required."),
[string]
$targetConnectionString = $(throw "-targetConnectionString is required."),
[string]
$targetTableName = $(throw "-targetTableName is required.")
)
@timgit
timgit / megaNumber.js
Last active January 15, 2020 08:35
Large number format filter for Angular written in ES6 that rounds to the specified decimal place (defaults to 1). 1 billion => 1B, 1,490,000 => 1.5M, 999,999 => 1M
angular.module('utilsModule').filter("megaNumber", () => {
return (number, fractionSize) => {
if(number === null) return null;
if(number === 0) return "0";
if(!fractionSize || fractionSize < 0)
fractionSize = 1;
var abs = Math.abs(number);