Skip to content

Instantly share code, notes, and snippets.

View pielegacy's full-sized avatar

Alex Billson pielegacy

  • Mecca Brands
  • Melbourne, Australia
  • 09:28 (UTC -12:00)
View GitHub Profile
@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
{
"Name" : "TestTomato",
"Origin" : "3095",
"Tastes" : "2"
}
@pielegacy
pielegacy / project.json
Last active January 16, 2017 07:42
My project.json file from that Medium article I dun did
{
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
@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)
{
@pielegacy
pielegacy / Tomato.cs
Created January 16, 2017 06:53
That stupid tomato class from that article
using System;
using System.ComponentModel.DataAnnotations;
namespace TomatoAPI
{
public class Tomato
{
[Key]
public int Id { get; set; }
[Required]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace TomatoAPI.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Controller
@pielegacy
pielegacy / Rogen Clan Ranking.md
Created January 2, 2017 10:25
Ranking of the Rogen Clan from This Is The End

Members

  1. Jonah Hill
  2. James Franco
  3. Danny McBride
  • He's like kinda better than Craig Robinson
  1. Craig Robinson
  • The Office
  • Wasn't in any shit Seth Rogen films? But he was
  1. Seth Rogen
  • The worst
@pielegacy
pielegacy / tasks.json
Created December 30, 2016 04:44
Python single file task runner
{
// Python Single File Task Runner for VS Code
// Written by Alex Billson (pielegacy)
"version": "0.1.0",
"command": "python",
"isShellCommand": true,
"args": [
"${file}"
],
"showOutput": "always"
@pielegacy
pielegacy / buildswin.bat
Last active August 2, 2016 00:44
Build SwinGame on Windows without an IDE
set PATH=%PATH%;C:\Windows\Microsoft.NET\Framework\v4.0.30319.
msbuild MyGameWin.csproj
bin\Debug\MyGame.exe
using SwinGameSDK;
namespace MyGame
{
// Just a few functions to help work with Swingame easily
// Created by Alex Billson
class SwinGameHelpers
{
public Vector newVect(float x, float y)
{