This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// default settings is located at: %userprofile%\scoop\apps\windows-terminal\current\defaults.json | |
// This file was initially generated by Windows Terminal (Unpackaged) 1.1.200810003-release1.1 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE dbo.USP_DROPANDRECREATEUSER | |
(@username VARCHAR(100), | |
@domain varchar(100)) | |
AS | |
BEGIN | |
DECLARE @loginName VARCHAR(200) = @domain + '\' + @username; | |
DECLARE @script VARCHAR(MAX); | |
IF EXISTS (SELECT 1 FROM sys.database_principals AS s WHERE s.name = @username) | |
BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- some UI that I would like to learn how it is done. | |
- Pluralsight - Edit Your Intrest page has bunch of 'pills' at the bottom that you could click and it will fill with a color to indicate selected. | |
- StackOverflow - tags - I like it how you can type on an input box and list of possible tags appear | |
- Toast Notification indicating something was saved or being saved or error | |
- Twitter - In update email notification - as you check boxes to opt in or opt out of email notification and circle with a tick mark appears indicating save was successful | |
- Angular survey - on angular survey, there was a page with list of items that was important, user could drag item up and down and change the order | |
- Facebook reactions | |
- sliding menu with animation (like in angular docs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit, ElementRef, ViewChild } from '@angular/core'; | |
import { FormGroup, FormBuilder } from '@angular/forms'; | |
// thanks to the article https://codeburst.io/focusing-on-form-elements-the-angular-way-e9a78725c04f | |
/* | |
key idea is: | |
identify the element from the dom tree (we accomplish this by giving id to the element and using ViewChild('id') to retrieve the element. | |
once we have the element as ElementRef (learn more about that), we can call focus() method on it. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import desired pipe and add it to the provider array in your module | |
import {CurrencyPipe} form "@angular/common"; | |
@NgModule({ | |
imports: [], | |
declarations: [], | |
exports: [], | |
providers: [ CurrencyPipe ] | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { FormBuilder, FormGroup, FormArray } from '@angular/forms'; | |
@Component({ | |
selector: 'app-tag', | |
templateUrl: `<div> | |
<form [formGroup]='tagForm'> | |
<label for="tag-input">Category</label> | |
<input type="text" id="tagInput" formControlName='tagInput' (keyup)="onKeyUp($event)" > | |
<ul class="tag-list"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ErrorLoggerMiddleware | |
{ | |
private readonly RequestDelegate m_NextDelegate; | |
private readonly IEventLogger m_EventLogger; | |
private readonly IDbLogger m_DbLogger; | |
public ErrorLoggerMiddleware(RequestDelegate next, IEventLogger eventLogger, IDbLogger dbLogger) | |
{ | |
m_NextDelegate = next; | |
m_EventLogger = eventLogger; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#SingleInstance force ;this supresses the dialogue box that confirms about running a new instance when an instance is already running. | |
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
; #Warn ; Enable warnings to assist with detecting common errors. | |
SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
;this is useful when using Vimium and I need to escape the entry field; my fav is when escaping intellisense help in VS | |
Capslock::Esc | |
;since we decided to use double quotes in our code-base, this is to skip having to hit shift all the damn time | |
;"::' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TimesheetCalculator { | |
constructor(shiftDurations) { | |
this.shiftDurations = shiftDurations; | |
} | |
getCalculatedTime() { | |
const durationsWithMinsInDecimal = this.shiftDurations.split(' '); | |
const durationsWithMins = []; | |
for (let duration of durationsWithMinsInDecimal) { | |
const hourPart = duration.split('.')[0]; |