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
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
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
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
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
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
/// <reference path="../app.js" /> | |
'use strict'; | |
app.factory('authService', ['$http', '$q', '$log', 'apiBaseUrl', 'localStorageService', function ($http, $q, $log, apiBaseUrl, localStorageService) { | |
var setupHttp = function() { | |
$http.defaults.headers.common["Content-Type"] = "application/x-www-form-urlencoded"; | |
$http.defaults.headers.common['Authorization'] = "Bearer " + authentication.access_token; | |
} | |
var authServiceFactory = {}; |
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 doing IP Address and network calculations | |
/// </summary> | |
public class IpRangeCalculator | |
{ | |
public readonly Dictionary<string, string> CidrSuffixesForMask = new Dictionary<string, string> | |
{ | |
{ "255.255.255.255", "32" }, | |
{ "255.255.255.254", "31" }, | |
{ "255.255.255.252", "30" }, |
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; | |
using System.Diagnostics; | |
using System.Net; | |
namespace EventLogListener | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
/** | |
* This directive asks the user for a Yes/No confirmation, and then requires the user to type a value to confirm the action. | |
* | |
* Usage: | |
<button confirm-by-typing confirm-action="deleteSite(site)" confirm-value="{{site.Path}}" alert-message="Are you sure you want to delete '{{site.Name}}'?" modal-title="Are you sure you want to delete '{{site.Name}}'?" modal-message="Enter the site path <strong>'{{site.Path}}'</strong> below to confirm."> | |
Delete | |
</button> | |
*/ | |
adminApp.directive("confirmByTyping", ["$modal", function ($modal) { | |
var getConfirmTypingModalTemplate = function (title, message) { |