Skip to content

Instantly share code, notes, and snippets.

Alex Ivanichev ivalexa

View GitHub Profile
@ivalexa
ivalexa / LCA
Created Sep 22, 2018
BinaryTree LCA
View LCA
class Node
{
int data;
Node left, right;
public Node(int item)
{
data = item;
left = right = null;
}
View ExpressErrorHandling.js
const express = require('express')
const app = express()
app.get('/', (request, response) => {
throw new Error('oops')
})
app.use((err, request, response, next) => {
// log the error, for now just console.log
console.log(err)
View EncodeFilter
public class EncodeFilter : ActionFilterAttribute
{
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
base.OnActionExecuted(filterContext);
var result = filterContext.Result as ViewResultBase;
if (result == null)
{
// The controller action didn't return a view result
You can’t perform that action at this time.