Skip to content

Instantly share code, notes, and snippets.

# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
@nareshjois
nareshjois / RInputOutput.md
Last active February 7, 2018 13:40
R Expression representation of JSON

For a Given Input

rnorm(c(10,20,30), 10, sd = 1)

The Output

{
    "errors": null, // In [{ line: number, column: number, message: string }]
    "tree": [

{

@nareshjois
nareshjois / RVisitor.js
Created February 7, 2018 13:37
R ANTLR Visitor
// Generated from R.g4 by ANTLR 4.7.1
// jshint ignore: start
var antlr4 = require('antlr4/index');
var filter = require('lodash/filter');
var map = require('lodash/map');
var isArray = require('lodash/isArray');
// This class defines a complete generic visitor for a parse tree produced by RParser.
function RVisitor() {
antlr4.tree.ParseTreeVisitor.call(this);
@nareshjois
nareshjois / arithmeticParser.js
Created February 7, 2018 13:24
Simple Arithmetic Parser using ANLTR
var input = "2343 + 5687"
var chars = new antlr4.InputStream(input);
var lexer = new arithmeticLexer.arithmeticLexer(chars);
var tokens = new antlr4.CommonTokenStream(lexer);
var parser = new arithmeticParser.arithmeticParser(tokens);
parser.buildParseTrees = true;
// Now we can either use Listener
var listener = new arithmeticListener.arithmeticListener();
antlr4.tree.ParseTreeWalker.DEFAULT.walk(listener, tree);
@nareshjois
nareshjois / arithmetic.g4
Created February 7, 2018 12:59
Simple Arithmetic Grammer
grammar arithmetic;
/*
* Parser Rules
*/
add : NUMBER '+' NUMBER ;
subtract : NUMBER '-' NUMBER ;
multiply : NUMBER '*' NUMBER ;
divide : NUMBER '/' NUMBER ;
@nareshjois
nareshjois / nginx.ssl.conf
Last active December 18, 2015 08:08
nginx Configuration with SSL
server {
listen 80 defaultserver;
listen [::]:80 defaultserver ipv6only=on;
server_name example.com; # Replace with your domain
return 301 https://$server_name$request_uri;
}
server {
listen 443 default_server;
class BoldCommand : ToggleCommand
{
public BoldCommand(RichTextBox TextControl)
: base(TextControl)
{
}
public override void ApplyFormatting()
{
ApplyToggle(FontStyle.Bold);
namespace TestApplication
{
[ScaffoldTable(true)]
[MetadataType(typeof(Attributes.Project))]
public partial class Project
{
}
[ScaffoldTable(true)]
[Required(ErrorMessage="Client Name is Required")]
[StringLength(256)]
[DisplayName("Client Name")]
[CustomValidation(typeof(ClientValidations), "ValidateClientName")]
public string ClientName { get; set; }
public static ValidationResult ValidateClientName(string ClientName, ValidationContext context)
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace WebApp.Test.Controllers
{
[HandleError]
public class HomeController : Controller