Skip to content

Instantly share code, notes, and snippets.

View chandermani's full-sized avatar

Chandermani chandermani

  • London
View GitHub Profile
{
"Id": "1-62472af4-2c5b5b25766186371734e751",
"Duration": 17.018,
"LimitExceeded": false,
"Segments": [
{
"Id": "46160f9f1396a63a",
"Document": {
"id": "46160f9f1396a63a",
"name": "DPAAS-PAY-SBX-BPME-OrderFunction",
@chandermani
chandermani / Heap.cs
Created May 26, 2021 18:40
C# heap implementation
using System;
using System.Collections.Generic;
using System.Text;
namespace DataStructures
{
public class Heap<T>
{
private T[] items;
private int size;
@chandermani
chandermani / AuthHttp.ts
Last active February 14, 2021 12:48
Angular 2, Http service wrapper to pass authorization token with each request.
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>();
@chandermani
chandermani / CacheImageFileConverter.cs
Created May 13, 2012 12:58
Windows Phone Image Caching Converter
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
@chandermani
chandermani / introrx.md
Created July 11, 2020 08:51 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
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){
@chandermani
chandermani / orderBy.ts
Created March 28, 2016 03:06
orderBy pipe in Angular2
@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("-")) {
@chandermani
chandermani / workout-history-tracker-v1.service.ts
Last active May 13, 2018 14:51
Workout History Tracker V1
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;
@chandermani
chandermani / web.config
Created January 22, 2014 16:04
ASP.Net Identity - Google OpenId redirect endpoint.
<location path="signin-google">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
.directive('myDirective', function () {
return {
restrict: 'E',
scope: {
model: '='
},
// The linking function will add behavior to the template
link: function (scope, element, attrs) {
}
};