This file contains hidden or 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
$scope.disposableMail = function (email) { | |
if (!email) return true; | |
return email.indexOf('@mailinator.com') >= 0 ? false : true; | |
} |
This file contains hidden or 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
$scope.duplicateMailRemoteCheck = function (email) { | |
return $timeout(function () { | |
return ['[email protected]', '[email protected]', '[email protected]'].indexOf(email) >= 0 ? false : true; | |
}, 2000); | |
} |
This file contains hidden or 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
<input type="email" | |
ng-model='userEmail' | |
name='email' required | |
class="form-control" | |
custom-validator="disposable" | |
validate-functions='disposableMail'/> |
This file contains hidden or 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
<input type="email" | |
ng-model='userEmail' | |
name='email' required | |
class="form-control" | |
custom-remote-validator="duplicate" | |
remote-validate-functions="duplicateMailRemoteCheck" | |
update-on-blur=""/> |
This file contains hidden or 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
var planEmployees = this.DB | |
.Query<Xhr.Data.Model.EmployeeLeavePlanView>("WHERE LeavePlanId=@0", p.Id); | |
planEmployees.ForEach(e => | |
{ | |
var creditHistory = this.LeavesService.GetCredits(e.ID); | |
var newCredits = creditCalculator.CalculateNewCredits(processStartTime, creditHistory); |
This file contains hidden or 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
var planEmployees = this.DB | |
.Query<Xhr.Data.Model.EmployeeLeavePlanView>("WHERE LeavePlanId=@0", p.Id) | |
.ToList(); //Did a ToList() to realize this query | |
// Same as it was earlier |
This file contains hidden or 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 {Injectable, EventEmitter} from 'angular2/core'; | |
import {Http, Headers, RequestOptions, RequestOptionsArgs, Response, RequestMethod, Request, Connection, ConnectionBackend} from 'angular2/http'; | |
import * as Rx from 'rxjs'; | |
export enum Action { QueryStart, QueryStop }; | |
@Injectable() | |
export class AuthHttp { | |
process: EventEmitter<any> = new EventEmitter<any>(); |
This file contains hidden or 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
@Pipe({ | |
name: 'orderBy' | |
}) | |
export class OrderByPipe { | |
transform(value: Array<any>, args: any[]): any { | |
let field: string = args[0]; | |
if(value==null) { | |
return null; | |
} | |
if (field.startsWith("-")) { |
This file contains hidden or 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 { CoreModule } from './core.module'; | |
import { Injectable } from '@angular/core'; | |
import { ExercisePlan } from '../workout-runner/model'; | |
@Injectable({ | |
providedIn: CoreModule | |
}) | |
export class WorkoutHistoryTrackerService { | |
private maxHistoryItems = 20; // Tracking last 20 exercises | |
private currentWorkoutLog: WorkoutLogEntry = null; |
This file contains hidden or 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
private void PrintMatrix(int[][] matrix){ | |
for(int i=0;i<matrix.Length;i++) { | |
for(int j=0;j<matrix[0].Length;j++) { | |
Console.Write(matrix[i][j] + " "); | |
} | |
Console.WriteLine(""); | |
} | |
} | |
private void PrintMatrix(int[,] matrix){ |