Skip to content

Instantly share code, notes, and snippets.

View pielegacy's full-sized avatar

Alex Billson pielegacy

  • Mecca Brands
  • Melbourne, Australia
  • 13:22 (UTC -12:00)
View GitHub Profile
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();
}
@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]
@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",
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 / Sandler Clan Ranking.md
Last active May 16, 2017 05:00
A ranking of the Sandler Clan members

Best Member

  1. Adam Sandler
  • The King
  • The OG
  • Billy Madison was good
  • Happy Gilmore was pretty good
  1. Chris Rock
  • Everybody Hates Chris > The Rest of the Material on this List
  1. Kevin James
  • Stellar filmography
@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)
{