Skip to content

Instantly share code, notes, and snippets.

View ihorbond's full-sized avatar
💻
Coding

Ihor Bodnarchuk ihorbond

💻
Coding
View GitHub Profile
@ihorbond
ihorbond / postgre to mssql
Last active March 7, 2019 22:00
Replace underscores and capitalize
let text = `
CREATE TABLE [dbo].[images]
(
[image_id] INT NOT NULL PRIMARY KEY,
[url] VARCHAR(200) NOT NULL,
[tour_id] INT NULL,
[user_id] INT NULL,
[created_on] DATETIME2(1) NULL DEFAULT GETDATE(),
CONSTRAINT [CK_images_tour_id] CHECK (tour_id is not null or user_id is not null),
CONSTRAINT [FK_images_users] FOREIGN KEY ([user_id]) REFERENCES [users]([user_id])
@ihorbond
ihorbond / zip-code.directive.ts
Last active July 20, 2018 22:39
Angular FormControl ZipCode Directive for North America
import { Directive, ElementRef, Input, HostListener} from '@angular/core';
import { NgControl, ValidationErrors } from '@angular/forms';
/*
* Directive to format zip codes on FormControl
*/
@Directive({
selector: '[zipCode]'
})