Skip to content

Instantly share code, notes, and snippets.

View xwipeoutx's full-sized avatar

Steve Leigh xwipeoutx

View GitHub Profile
@xwipeoutx
xwipeoutx / Car.cs
Created June 6, 2016 13:01
Simple, clean, fast IQueryable filter with expression chaining in C#
using System;
namespace ExpressionChainDemo
{
public class Car
{
public DateTime RegistrationDate { get; set; }
public DateTime PurchaseDate { get; set; }
}
}
@xwipeoutx
xwipeoutx / validate-accessibility.js
Created October 21, 2016 00:34
Accessibilities
(function() {
var invalidElementFinders = {
"Lists should have titles": () => Array.from(document.querySelectorAll("ul,li")).filter(el => !el.title),
"Articles should be aria-labelledby": () => Array.from(document.querySelectorAll("article")).filter(el => !el.getAttribute("aria-labelledby")),
}
var validateAccessibility = function () {
Array.from(document.querySelectorAll("*")).forEach(el => {
el.classList.remove("is-not-accessible");
if (el.problems) delete el.problems

Git Extensions

Path to mergetool:

C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe

Mergetool command:

"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe" /m /r="$MERGED" "$LOCAL" "$BASE" "$REMOTE"
@xwipeoutx
xwipeoutx / mr-setup.md
Last active December 21, 2018 01:52
Setting up for mixed reality

If you want to prepare your PC beforehand, I would

  • Install Unity Hub. This handled multiple Unity versions on the same PC and is a life saver
  • Install the latest Unity from (whatever it happens to be - there won't be any major releases soon AFAIK). Include all the UWP/Windows store things and the IL2CPP scripting engine support
    • If you're more interested in doing AR for the tablet or phone, then install those SDKs too - it's really up to you what you want to get out of it
    • Careful with the installer and it telling you to install VS 2018. There's a checklist here - but I wouldn't worry about the emulator. It sucks.
  • Do a quick "Hello, world"
  • -or- do my old "Hello, world!" tutorial (I will
@xwipeoutx
xwipeoutx / xr-tech-interview.md
Last active May 8, 2024 14:31
XR Tech Interview Questions

XR specific tech interview

AR / VR / MR / XR

  • Explain what is AR / VR / XR / MR, how are they connected? Why would you choose one over another?
  • Your client is saying "I want a HoloLens app that can do X".  How do you qualify if they're wasting their money?
  • Tell me about some logistical implications of this tech in the enterprise?
  • How does developing an XR app differ from a traditional 2D or 3D game / app?
  • Specifically, what are some downsides to translucent displays (HoloLens, Magic Leap), and how do you accommodate for them?
export async function getParcel(coords: {lat: number, lng: number}): Promise<Feature> {
let url = `https://gisservices.information.qld.gov.au/arcgis/rest/services/PlanningCadastre/LandParcelPropertyFramework/MapServer/4/query?geometry=${coords.lng}%2C${coords.lat}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelIntersects&outFields=*&returnGeometry=true&outSR=4326&f=geojson`
let response = await fetch(url);
let collection = await response.json();
return (collection && collection.features[0]) || null;
}
@xwipeoutx
xwipeoutx / ar-hello-world-astronaut.html
Last active August 8, 2020 11:40
Hello, World of WebXR - an astronaut in your living room.
<html>
<head>
<title>Model Viewer Example</title>
<script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
<script nomodule src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"></script>
</head>
<body>
<model-viewer src="https://stevesspace.com/assets/models/Astronaut.glb"
ar ar-modes="webxr scene-viewer quick-look" ar-scale="auto" camera-controls
alt="A 3D model of an astronaut"
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;
namespace Project.Scripts.Editor
@xwipeoutx
xwipeoutx / generate-icons.js
Last active December 14, 2020 22:19
Generates all the UWP icons with sensible naming, based of a couple initial files.
let imageConversion = require("image-conversion");
var fs = require("fs");
let jimp = require("jimp");
let ImageJs = require("image-js");
let output = "public/images/icon";
const scales = [100, 125, 150, 200, 240, 400];
const iconTargetSizes = [16,24,32,48,256];
const iconTargetDecorations = ['unplated_targetsize', 'targetsize'];
@xwipeoutx
xwipeoutx / delete-old-github-artifacts.ps1
Created August 30, 2024 01:13
Powershell script to delete github artifacts older than N days old.
# Variables
$repo = "Owner/RepoName"
$daysAgo = 14
$twoWeeksAgo = (Get-Date).AddDays(-$daysAgo).ToString("yyyy-MM-ddTHH:mm:ssZ")
# Fetch all artifacts older than 2 weeks
$artifacts = gh api "repos/$repo/actions/artifacts" --paginate --jq ".artifacts | map(select(.created_at < `"`"$twoWeeksAgo`"`"`"))" | ConvertFrom-Json
# Check if there are any artifacts