Skip to content

Instantly share code, notes, and snippets.

View ansarizafar's full-sized avatar

Zafar Ansari ansarizafar

View GitHub Profile
SQL Server 2017
----------------
Enterprise Core - 6GPYM-VHN83-PHDM2-Q9T2R-KBV83
Developer - 22222-00000-00000-00000-00000
Enterprise - TDKQD-PKV44-PJT4N-TCJG2-3YJ6B
Standard - PHDV4-3VJWD-N7JVP-FGPKY-XBV89
Web - WV79P-7K6YG-T7QFN-M3WHF-37BXC
https://www.teamos-hkrg.com/index.php?threads/microsoft-sql-server-english-2017-rtm-teamos.42103/
@ansarizafar
ansarizafar / gun-service.sh
Created July 27, 2021 17:03 — forked from bioshazard/gun-service.sh
Automation for installing GunDB as a service (tested on Pi)
#!/bin/bash
## Usage: GUN_USER=gun GUN_ROOT=~gun/gun-pi-custom GUN_BRACH=master gun-service.sh
# Should be run as root (with sudo or directly)
[[ "$(whoami)" == "root" ]] || { echo "Must be run as root"; exit 1; }
# Setup default environment
[ -z "${GUN_USER}" ] && GUN_USER="pi"
GUN_DETECTED_USER_HOME=$(getent passwd ${GUN_USER} | cut -d: -f6)
@ansarizafar
ansarizafar / Event-stream based GraphQL subscriptions.md
Created July 4, 2021 05:35 — forked from OlegIlyenko/Event-stream based GraphQL subscriptions.md
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@ansarizafar
ansarizafar / Accordian.svelte
Created November 20, 2020 15:00 — forked from matryer/Accordian.svelte
Simple Accordian component for Svelte (from https://firesearch.dev)
<script lang='ts'>
import { slide } from 'svelte/transition'
export let open: boolean = false
export function toggle() {
open = !open
}
</script>
<a
href='#open'
on:click|preventDefault={ toggle }
@ansarizafar
ansarizafar / visualstudio2019Key.txt
Created August 10, 2020 19:41
Visual Studio 2019 Product Key
Visual Studio 2019 Product Key
[Please Star this gist]
Follow My Account --> https://github.com/ch-kashif @ch-kashif
Lets do a code together
Join Cloud Disk repository --> https://github.com/ch-kashif/CloudDisk
@ansarizafar
ansarizafar / PostgreSQL_index_naming.rst
Created August 7, 2020 09:54 — forked from popravich/PostgreSQL_index_naming.rst
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@ansarizafar
ansarizafar / AAA_uuid_generate_v6mc.sql
Created July 25, 2020 07:36 — forked from bjeanes/AAA_uuid_generate_v6mc.sql
Postgres UUIDv6 (non-standard)
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- My port of https://github.com/kurttheviking/uuid-with-v6-js
-- A hacky translation of:
-- - http://gh.peabody.io/uuidv6/
-- - https://tools.ietf.org/html/draft-peabody-dispatch-new-uuid-format
CREATE OR REPLACE FUNCTION uuid_v1_to_v6(v1 uuid)
RETURNS uuid AS $$
DECLARE
v6 text;
CREATE OR REPLACE FUNCTION generate_sequential_uuid(p_interval_length int DEFAULT 60)
RETURNS uuid
LANGUAGE plpgsql
AS $$
DECLARE
v_i int;
v_time bigint;
v_bytes int[16] = '{}';
v_hex text[16] = '{}';
BEGIN
@ansarizafar
ansarizafar / ConsoleApp1.csproj
Created July 19, 2020 08:54 — forked from KelsonBall/ConsoleApp1.csproj
Curly Bracketn't Todos List API in C#
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@ansarizafar
ansarizafar / ModelStateValidationFilter.cs
Created June 18, 2020 16:23 — forked from Ciantic/ModelStateValidationFilter.cs
Model state validation filter ASP.NET Core
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
namespace Example
{
public class ModelStateValidationFilter : Attribute, IActionFilter
{
public void OnActionExecuting(ActionExecutingContext context)
{