Skip to content

Instantly share code, notes, and snippets.

View PandiyanCool's full-sized avatar
♥️
Coding!

Pandiyan Murugan PandiyanCool

♥️
Coding!
View GitHub Profile
// ES 7
var fruits = ['mango', 'jack fruit', 'banana' ]
fruits.includes('mango') // true
fruits.includes('orange') // false
// Earlier
// Math.pow (x, y)
Math.pow(2,3) // 8
2 ** 3
// 8
// where first digit is base and second digit is exponent
var square = 5 ** 2;
console.log(square) // 25
@PandiyanCool
PandiyanCool / Event.cs
Last active October 15, 2018 18:29
What’s new in ASP.NET Core – Web API improvements – HTTP-REPL
public class Event
{
public int Id { get; set; }
public string Organiser { get; set; }
public DateTime EventDate { get; set; }
}
namespace APITest.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class EventsController : ControllerBase
{
private readonly EventContext _context;
public EventsController(EventContext context)
{
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:32022",
"sslPort": 44384
}
},
using Microsoft.AspNetCore.Mvc.ApiExplorer;
namespace Microsoft.AspNetCore.Mvc
{
public static class DefaultApiConventions
{
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)]
[ProducesDefaultResponseType]
[ProducesResponseType(201)]
[ProducesResponseType(400)]
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-localize": {
"projectType": "application",
"i18n": {
"locales": {
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en-US" datatype="plaintext" original="ng2.template">
<body>
<trans-unit id="8298328021206315701">
<source>angular-localize</source>
<target>Bonjour</target>
</trans-unit>
</body>
</file>
<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en-US" datatype="plaintext" original="ng2.template">
<body>
<trans-unit id="3902961887793684628">
<source>hello</source>
<target>வணக்கம்</target>
</trans-unit>
</body>
</file>
@Injectable({
providedIn: 'root'
})
export class CustomPreload implements PreloadingStrategy {
preload(route: Route, load: (): Observable<any>): Observable<any> {
// you implement this function somewhere, somehow
if (isActiveCardRoute(route)) {
// this will make it load immediately
return load();
} else {