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
function isEmptyOrWhiteSpace(val) { | |
return _.isObject(val) | |
? _.isEmpty(val) | |
: _.chain(val).trim().isEmpty().value(); | |
} | |
_.mixin({ 'isEmptyOrWhiteSpace': isEmptyOrWhiteSpace }); | |
console.log(_.isEmptyOrWhiteSpace(""), true); | |
console.log(_.isEmptyOrWhiteSpace(" "), true); |
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
export class Checkbox implements ng.IComponentOptions { | |
public bindings: any = { | |
ngModel: "=", | |
defaultValue: "<", | |
label: "<" | |
}; | |
public template: string = ` | |
<div type="button" | |
class="btn btn-default" |
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 MultiselectController { | |
public static $inject = ["$timeout", "$scope"]; | |
public allSelectedLabel: string; | |
public options: IMultiselectOption[]; | |
public ngModel: IMultiselectOption[]; | |
private _maxLabelItems: number = 3; | |
private _clickTracker: IMultiselectOption[]; |
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
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.EntityFrameworkCore.Infrastructure; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore; | |
namespace MyApp.Api |
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
declare module _ { | |
interface LoDashStatic { | |
arraySafeReplace: (existingArray: any[], newArray: any[]) => any[]; | |
} | |
} | |
_.mixin({ "arraySafeReplace": (existingArray: any[], newArray: any[]) => { | |
if (existingArray) { | |
existingArray.length = 0; | |
} else { |
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
export class ComponentModalService { | |
public static $inject = ["$uibModal"]; | |
private _modalInstance: ng.ui.bootstrap.IModalServiceInstance; | |
public constructor( | |
private _modalService: ng.ui.bootstrap.IModalService | |
) { | |
} |
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
/// <binding ProjectOpened='watch' /> | |
/// <reference path="node_modules/systemjs/dist/system.js" /> | |
/// <binding ProjectOpened='default' /> | |
var gulp = require("gulp"); | |
var less = require("gulp-less"); | |
var ts = require("gulp-typescript"); | |
var minifyCss = require("gulp-minify-css"); | |
var concatCss = require("gulp-concat-css"); | |
var concat = require("gulp-concat"); |
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
Show hidden characters
{ | |
"rules": { | |
"class-name": true, | |
"comment-format": [ | |
true, | |
"check-space" | |
], | |
"curly": true, | |
"indent": [ | |
true, |
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
/// <summary> | |
/// Class for building CSV outputs | |
/// </summary> | |
/// <seealso cref="System.IDisposable" /> | |
public class CsvBuilder : IDisposable | |
{ | |
private readonly StringBuilder _stringBuilder; | |
private readonly string _delimiter; |
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
using System.Data.SqlClient; | |
using System.Configuration; | |
namespace DapperTest | |
{ | |
public static class ContextFactory | |
{ | |
public static SqlConnection Create() => new SqlConnection(ConfigurationManager.ConnectionStrings["MyCxn"].ConnectionString); | |
} | |
} |