Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Net;
using System.Net.Http;
using System.Net.Mime;
using System.Text;
using System.Text.Json;
using Microsoft.AspNetCore.Mvc.Testing;
using ServerSide;
using Xunit;
var restaurant = new Restaurant() {
Id = 1,
Name = "My Kitchen 1",
Address = "New Brunswick, 2657 Webster Street",
Speciality = "Hamburgers",
Open = true,
Review = 4
};
return View(restaurant);
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
class Solution {
@escalonn
escalonn / delegates.cs
Last active May 14, 2020 17:20
delegate-based polymorphism without generics
using System.Collections;
namespace DelegateExample
{
class Program
{
static void Main()
{
var list1 = new ArrayList { 1, 2, 3 };
var list2 = new ArrayList { 1, 3, 2 };
using System;
using System.Net.Http;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using KitchenSite.Ui.Models;
using Microsoft.Extensions.Configuration;
namespace KitchenSite.Ui.Services
{
@escalonn
escalonn / 1804-.net-project1.md
Created May 2, 2018 01:49
April 2018 .NET Project 1 requirements

project 1: restaurant review application

April 2018 .NET / Pushpinder Kaur, Nick Escalona

functionality

  • display top 3 restaurants by average rating
  • display all restaurants
    • should allow more than one method of sorting
  • display details of a restaurant
  • display all the reviews of a restaurant
  • search restaurants (e.g. by partial name), and display all matching results
  • create, update, delete restaurants
@escalonn
escalonn / yemeni.py
Created January 14, 2018 02:42
yemeni.py
#!/usr/bin/env python3
import re
from ck2parser import rootpath, is_codename, get_cultures, Pair, SimpleParser, FullParser
import print_time
def process_title(title_pair):
title, tree = title_pair.key.val, title_pair.value
for pair in tree:
if is_codename(pair.key.val):
@escalonn
escalonn / gist:8a7aa50f62effe38e7ff4ddb0107f867
Created April 20, 2016 23:16
yaml-fied monokai tmtheme
name: Monokai
settings:
- settings: {activeGuide: '#9D550FB0', background: '#272822', bracketContentsForeground: '#F8F8F2A5',
bracketContentsOptions: underline, bracketsForeground: '#F8F8F2A5', bracketsOptions: underline,
caret: '#F8F8F0', findHighlight: '#FFE792', findHighlightForeground: '#000000',
foreground: '#F8F8F2', invisibles: '#3B3A32', lineHighlight: '#3E3D32', selection: '#49483E',
selectionBorder: '#222218', tagsOptions: stippled_underline}
- name: Comment
scope: comment
settings: {foreground: '#75715E'}
########################################;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#TRIBALSCOTTISH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
########################################;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
tribal_baron_scottish;Toisech;Toisech;Toisech;;Toisech;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_baron_female_scottish;Toisecha;Toisecha;Toisecha;;Toisecha;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_baron_title_ruler_consort_scottish;Toisech;Toisech;Toisech;;Toisech;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_baron_title_ruler_consort_female_scottish;Toisecha;Toisecha;Toisecha;;Toisecha;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_count_scottish;Earl;Earl;Earl;;Earl;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_count_title_ruler_consort_scottish;Earl;Earl;Earl;;Earl;;;;;;;;;x;;;;;;;;;;;;;;;
tribal_duke_scottish;Mormaer;Mormaer;Mormaer;;Mormaer;;;;;;;;;x;;;;;;;;;;;;;;;
## normal scopes(including posttitle scopes) ##
# ROOT = receiver
# FROM = giver
# <no scope change> = attacker or receiver
## title scopes ##
# ROOT = receiver
# FROM = giver
# <no scope change> = thirdparty landed title
#
# the following effects/triggers exists (example execution order: on_success->on_success_title->on_success_posttitle):