Skip to content

Instantly share code, notes, and snippets.

View RoystonS's full-sized avatar
💭
Life events have taken over right now. Back soon.

Royston Shufflebotham RoystonS

💭
Life events have taken over right now. Back soon.
  • Forensic Analytics
  • Cambridge, UK
  • 15:42 (UTC +01:00)
View GitHub Profile
@RoystonS
RoystonS / bbl-installation-diagnostics.cmd
Last active February 1, 2022 18:01
Better Bravo Lights installation diagnostics script
@echo off
echo START OF BETTER BRAVO LIGHTS INSTALLATION DIAGNOSTICS
echo Microsoft Store location
echo "%LOCALAPPDATA%\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache"
dir "%LOCALAPPDATA%\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache"
if EXIST "%LOCALAPPDATA%\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache" (
echo UserCfg.opt InstalledPackage
find "InstalledPackage" "%LOCALAPPDATA%\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache\UserCfg.opt"
@RoystonS
RoystonS / bbl-installation-diagnostics.cmd
Created February 1, 2022 17:42
Better Bravo Lights installation diagnostics script
@echo off
echo START OF BETTER BRAVO LIGHTS INSTALLATION DIAGNOSTICS
echo Microsoft Store location
echo "%LOCALAPPDATA%\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache"
dir "%LOCALAPPDATA%\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache"
if EXIST "%LOCALAPPDATA%\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache" (
echo UserCfg.opt InstalledPackage
find "InstalledPackage" "%LOCALAPPDATA%\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache\UserCfg.opt"
@RoystonS
RoystonS / PY0101EN-1-1-Types.ipynb
Created May 26, 2019 21:53
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RoystonS
RoystonS / PY0101EN-1-1-Types.ipynb
Created May 26, 2019 21:52
Created on Cognitive Class Labs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RoystonS
RoystonS / looksLike.ts
Created May 16, 2019 12:59
looksLike typing
type ComparisonPredicate<T> = (value: T) => boolean;
type ComparisonObject<T> = { [P in keyof T]?: ComparisonObject<T[P]> | ComparisonPredicate<T[P]> };
function looksLike<T>(obj: T, comparison: ComparisonObject<T>): boolean {
return true;
}
@RoystonS
RoystonS / rtlcssjs-stylis.js
Last active May 25, 2018 14:59
A stylis plugin for integrating with rtl-css-js
// See https://github.com/thysultan/stylis.js#plugins for documentation on how stylis plugins work
function stylisPlugin(context, content) {
if (context === 1) {
// content is a single CSS rule, like 'background-color: pink'
// RTL-CSS-JS requires the key + value to be passed in separately.
const [key, value] = content.split(/:/, 2);
// TODO: this is a bit onerous: rtlcssjs doesn't expose convertProperty, only the entire object convert
// Create an object containing our one property
@RoystonS
RoystonS / gist:f7984c1acd272d2e4daf0382c23c3d83
Last active March 15, 2018 19:48 — forked from clintel/gist:1155906
Fenced code in bullet lists with GitHub-flavoured MarkDown??

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    Code
    More Code
    
// Returns an iterator of all positive integers
function* allPositiveIntegers(): IterableIterator<number> {
let i = 1;
while (true) {
yield i++;
}
}
// Returns an iterator which passes through selected items
// from another iterator, selected by a predicate
@RoystonS
RoystonS / TestComponent.ts
Created July 10, 2017 10:21
Sample complex file for parsing
import * as React from 'react';
interface IMyPropsBase {
thisIsAPropInABaseInterface: string;
}
interface IMyProps extends IMyPropsBase {
thisIsAPropInASubtypeInterface: number;
onSomething(value: number): void;
@RoystonS
RoystonS / parse.js
Created July 10, 2017 10:17
Parses a TS/TSX file to extract props for any exports, using TypeScript compiler
"use strict";
// Demonstrates extracting complete props info, using real TypeScript
// compiler type info.
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
//
var ts = require("typescript");
var fs = require("fs");
var path = require("path");
// Arguments: