Skip to content

Instantly share code, notes, and snippets.

@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'}
@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 / 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
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 / 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.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
class Solution {
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.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;
// Hello world HTTP server, listens on port 5000
// usage: dotnet Hello.dll
// dotnet run
using System.Net;
using System.Net.Sockets;
using System.Security;
string text = "Hello, World!";
// .NET language server, displays errors and warnings in real time
// usage: dotnet LanguageServer.dll [PROJECT|SOLUTION]
// dotnet run -- [PROJECT|SOLUTION]
// example: dotnet run --project ../LanguageServer -- .
using System.Diagnostics;
string project = args[0];
string directory =