Skip to content

Instantly share code, notes, and snippets.

View faridprogrammer's full-sized avatar
😃
Working

Farid Bekran faridprogrammer

😃
Working
View GitHub Profile
@faridprogrammer
faridprogrammer / Countries.SQL
Created April 10, 2020 12:38 — forked from abroadbent/Countries.SQL
SQL Server T-SQL For Countries Table
CREATE TABLE Countries (
Id int IDENTITY(1,1) NOT NULL,
Iso varchar(2) NOT NULL,
Name varchar(80) NOT NULL,
Iso3 varchar(3) NULL,
NumCode int NULL,
PhoneCode int NOT NULL,
CONSTRAINT [PK_Countries] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [uc_Countries_Iso] UNIQUE NONCLUSTERED ([Iso] ASC)
)
@faridprogrammer
faridprogrammer / DropAllObject.sql
Created July 7, 2019 06:15 — forked from dannylloyd/DropAllObject.sql
Deletes all objects in database
/* Drop all non-system stored procs */
DECLARE @name VARCHAR(128)
DECLARE @SQL VARCHAR(254)
SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name])
WHILE @name is not null
BEGIN
SELECT @SQL = 'DROP PROCEDURE [dbo].[' + RTRIM(@name) +']'
EXEC (@SQL)
@faridprogrammer
faridprogrammer / two-way-binding.js
Created January 19, 2019 06:48 — forked from straker/two-way-binding.js
Simple and small two-way data binding between DOM and data
/**
* @param {object} scope - Object that all bound data will be attached to.
*/
function twoWayBind(scope) {
// a list of all bindings used in the DOM
// @example
// { 'person.name': [<input type="text" data-bind="person.name"/>] }
var bindings = {};
// each bindings old value to be compared for changes