Skip to content

Instantly share code, notes, and snippets.

View pielegacy's full-sized avatar

Alex Billson pielegacy

  • Mecca Brands
  • Melbourne, Australia
  • 08:34 (UTC -12:00)
View GitHub Profile
@pielegacy
pielegacy / TomatoDb.cs
Created January 16, 2017 07:11
The database context for our tomato database
using Microsoft.EntityFrameworkCore;
namespace TomatoAPI
{
public class TomatoDb : DbContext
{
// Reference our tomato table using this
public DbSet<Tomato> Tomatos { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseCors(options => options.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod().AllowCredentials());
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
app.UseMvc();
}
{
"Name" : "TestTomato",
"Origin" : "3095",
"Tastes" : "2"
}
@pielegacy
pielegacy / TomatosController.cs
Created January 16, 2017 09:01
The entire tomatos controller from my medium article
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
@pielegacy
pielegacy / block-music-recommendations.md
Last active March 15, 2017 00:13
Great Chill Time Albums
@pielegacy
pielegacy / MVC In The Web.md
Last active May 22, 2017 10:58
A basic overview of how we can use the MVC design pattern in our frontend web applications thanks to AngularJS

MVC in The Web

The Model-View-Controller (also known as MVC) in many ways is the cornerstone of modern web application development. Through seperation of these three major aspects of an application we are able to ensure that our product is not only a solid user experience but a structured development experience as well. Before we get into what MVC is and how we can facilitate it in modern Web Application development, we need to ensure that we're up to scratch with our basic web technologies.

HTML, The Looks

@pielegacy
pielegacy / angular-report.md
Created May 29, 2017 12:44
Power Up your Angular 1.x projects with Typescript, An explorative report by Alex Billson

Power Up your Angular 1.x projects with Typescript

An explorative report by Alex Billson

header

AngularJs for years has provided a very solid framework for creating scalable MVC (Model View Controller) and MVVM (Model View ViewModel) applications using HTML, CSS and JavaScript.

popularity

As shown in this graph from May 2016, newer versions of the framework such as Angular 2 and Angular 4 despite being more feature-full and efficient than its predecessors have still failed to

How to work with MonoGame's Content Pipeline

With all the documentation you'll read for XNA, there will be one differentiating factor and that is the content pipeline.

The Content Pipeline can be a pain in the ass but it's overall very helpful as it nicely packages content for the game in the Content folder.

This tutorial will show you how to import a texture and load it in the game.

@pielegacy
pielegacy / JS-LINQ.js
Last active March 19, 2018 03:39 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
@pielegacy
pielegacy / FrozenOakAPIDocs.md
Created December 27, 2017 00:12
Documentation for the Frozen Oak Locator API Endpoint @ https://www.frozenoak.com.au/

Frozen Oak API Documentation

Alex Billson (@pielegacy)

Preface

The Frozen Oak is a revolution in beverages and being the forward thinking company that Oak is it was only right that an associated Frozen Oak Locator was developed. This locator is powered by a versatile, simple,