Skip to content

Instantly share code, notes, and snippets.

View arunselvakumar's full-sized avatar
:octocat:
Writing Code

Arun Selva Kumar arunselvakumar

:octocat:
Writing Code
View GitHub Profile
@arunselvakumar
arunselvakumar / hero.ts
Created April 12, 2021 02:55 — forked from brennanMKE/hero.ts
Example of Mongoose with TypeScript and MongoDb
import * as mongoose from 'mongoose';
export let Schema = mongoose.Schema;
export let ObjectId = mongoose.Schema.Types.ObjectId;
export let Mixed = mongoose.Schema.Types.Mixed;
export interface IHeroModel extends mongoose.Document {
name: string;
power: string;
@arunselvakumar
arunselvakumar / angular-tip-httpclient-results-map.md
Created February 15, 2019 15:53 — forked from killerchip/angular-tip-httpclient-results-map.md
Angular Tip: Map HttpClient results to your model class

Map HttpClient results to model

When you use remote APIs, you might not have the model of the reponse JSON object, or it might not match to your app model. Don't be afraid to use map operator to transform the results.

Example

If you query https://jsonplaceholder.typicode.com/posts/ you will receive an array of articles. An article has the following format:

@arunselvakumar
arunselvakumar / ultimate-ut-cheat-sheet.md
Created January 3, 2019 05:28 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@arunselvakumar
arunselvakumar / angular-styleguide-polymer-reqs.md
Created November 11, 2018 14:48 — forked from Smolations/angular-styleguide-polymer-reqs.md
Angular Styleguide Goodies for Polymer

This document was created by modifying John Papa's README.md at his GitHub project. All references to "me," "my," etc. refer to him.

Devs listed in the checkbox groups should go through each style suggestion, and check off those styles which they agree with, even partially. ONLY LEAVE A CHECKBOX UNCHECKED IF YOU COMPLETELY DISAGREE WITH THE STYLE SUGGESTION. If you only partially agree, leave a comment referencing the style number (e.g. Y271) and it will be addressed in the sync which will occur after every dev has reviewed the document.

Keep in mind that some of these things we already do, while others we already partially do. This document may eventually end up in the handbook so it will act as an all-encompassing styleguide for us.

Angular Style Guide

Opinionated Angular style guide for teams by John Papa

<!-- Flat ComboBox -->
<SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="#e3e9ef" />
<SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="#fff" />
<SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" />
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" />
<SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" />
<ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate">
<Grid>
<Grid.ColumnDefinitions>
@arunselvakumar
arunselvakumar / DataGridDetailsExample.xaml
Created December 13, 2017 07:52 — forked from tomestephens/DataGridDetailsExample.xaml
A very simple example for using WPF to hide/show the row details on a DataGrid.
<UserControl x:Class="DataGridExample.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:converters="clr-namespace:DataGridExamples.Converters"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<ResourceDictionary>