Skip to content

Instantly share code, notes, and snippets.

@jelster
jelster / CircleShape.json
Created October 3, 2021 15:08
BabylonJS Node Material Editor Fragment Shader reusable frame
{
"editorData": {
"locations": [
{
"blockId": 3545,
"x": 1600,
"y": 1400
},
{
"blockId": 3548,
@jelster
jelster / which.ps1
Created July 14, 2020 13:39
Which... for Powershell
function which([string]$name) {
return (get-command $name -UseFuzzyMatching).Definition;
}
@jelster
jelster / BasicTests.cs
Last active August 2, 2021 06:50
ASP.NET Core 2.1 - Setting up functional integration tests with authentication middleware
using Microsoft.AspNetCore.Mvc.Testing;
using System.Net;
using System.Threading.Tasks;
using Xunit;
using System.Net.Http;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Api.FunctionalTests
{
@jelster
jelster / InRuleServerDSC.ps1
Last active July 21, 2017 20:20
Containerizing the InRule Stack
Configuration Website
{
param ($MachineName = "localhost")
Node ($MachineName)
{
WindowsFeature WebServerRole
{
Name = "Web-Server"
Ensure = "Present"
@jelster
jelster / mapdata.html
Last active August 29, 2015 14:11
Canvas + SVG versions of the MWO CW map as read from public API
<!DOCTYPE html>
<html>
<head>
<title>The Inner Sphere</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width" name="viewport" />
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.1.1.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js" ></script>
<style type="text/css">
@jelster
jelster / mech-importer.ps1
Last active August 29, 2015 14:01
MWO Asset Scripts
Function Get-MwoBlenderMech
{
[CmdletBinding()]
param(
[Parameter(Position = 0, Mandatory = $True, ValueFromPipeline=$true)]
[Alias('Family')]
[Alias('Chassis')]
[string[]]$MechFamily,
[Parameter(Position=1, Mandatory=$false, valuefrompipeline=$false)]
[Alias('Path')]
@jelster
jelster / RecursiveNamespaceVisitor.cs
Created May 22, 2012 22:13
sample implementation of a recursive (indirectly speaking) SymbolVisitor for Roslyn CTP. Returns flattened list of type symbols regardless of namespace nesting
public class Walk : SymbolVisitor<NamespaceSymbol, IEnumerable<NamedTypeSymbol>>
{
protected override IEnumerable<NamedTypeSymbol> VisitNamespace(NamespaceSymbol symbol, NamespaceSymbol argument)
{
var types = new List<NamedTypeSymbol>();
foreach (var ns in symbol.GetNamespaceMembers())
{
var closeTypes = types;
@jelster
jelster / authenticateandauthorizeacsattributes.cs
Created March 22, 2012 18:31
Azure ACS Authorize attribute MVC4Beta + WebAPI Beta
public class AuthenticateAndAuthorizeAcsMvcAttribute : System.Web.Mvc.AuthorizeAttribute
{
public override void OnAuthorization(System.Web.Mvc.AuthorizationContext filterContext)
{
var principal = filterContext.HttpContext.User;
if (principal == null || !principal.Identity.IsAuthenticated)
{
filterContext.Result = new ViewResult()
{
ViewName = "AcsLogin",