Skip to content

Instantly share code, notes, and snippets.

View iaincollins's full-sized avatar
:shipit:

Iain Collins iaincollins

:shipit:
View GitHub Profile
@iaincollins
iaincollins / Cloud Save.md
Last active February 14, 2024 15:54
Using Unity Cloud Save for Game Logic

Here is an example of how it's possible to do something like player matching with Unity Cloud Save SDK 3.1

  1. Write to the data you want to use for matching (e.g. region, language, level, etc) to Player Data in the Public Access Class (Public Data is readable by other players).
using SaveOptions = Unity.Services.CloudSave.Models.Data.Player.SaveOptions;

var data = new Dictionary<string, object> { { "location", "Paris" } };
await CloudSaveService.Instance.Data.Player.SaveAsync(data, new SaveOptions(new PublicWriteAccessClassOptions()));
@iaincollins
iaincollins / Elite Dangerous Events.txt
Created April 9, 2023 13:02
A list of events in Elite Dangerous
Elite Dangerous Events
https://elite-journal.readthedocs.io/en/latest/
Journal Events
Cargo
ClearSavedGame
Commander
Loadout
Materials
@iaincollins
iaincollins / Markdown.md
Created September 15, 2022 22:08
Aalternate light/dark images with GitHub Flavour Markdown
Logo
@iaincollins
iaincollins / adr_template.md
Last active September 20, 2021 14:26
ADR Template

[short title of solved problem and solution]

  • Status: [accepted | superseded by ADR-0005 | deprecated | …]
  • Deciders: [list everyone involved in the decision]
  • Date: [YYYY-MM-DD when the decision was last updated]

Technical Story: [description | ticket/issue URL]

Context and Problem Statement

@iaincollins
iaincollins / CONTRIBUTING.md
Created October 26, 2018 09:32
How to Contribute

How to contribute

See the instructions in README.md for how to run the code.

When developing a feature, you should start by scoping out a spec, developing tests against that spec and writing code against the tests. Working with others to review the spec before starting development is encouraged.

Raise a Pull Request

  1. When you create a branch, it should reflect the nature of the change.
@iaincollins
iaincollins / Google Spreadsheet.js
Last active May 30, 2021 16:03
Example Node.js code to append to a Google Spreadsheet every hour
/**
* Append data to a Google Spreadsheet
*
* You will need a file called '.env' with the following values:
*
* - GOOGLE_ID (Google oAuth Client ID)
* - GOOGLE_SECRET (Google oAuth Client Secret)
* - GOOGLE_REFRESH_TOKEN (Google oAuth Refresh Token)
* - GOOGLE_SPREADSHEET_ID (Google Spreadsheet ID)
*
@iaincollins
iaincollins / pizza-filter-long.js
Created March 19, 2020 01:50
Pizza Filter (long and short form example)
// Long form example
const pizzas = [
{
name: 'Margarita',
toppings: ['Cheese', 'Tomato']
},
{
name: 'Hawaiian',
toppings: ['Cheese', 'Tomato', 'Ham', 'Pineapple']
},
@iaincollins
iaincollins / deploy.yml
Created February 4, 2020 00:29
Example GitHub action to place somewhere like .github/workflows/deploy.yml
name: Deploy on push to master
on:
push:
branches:
- master
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
@iaincollins
iaincollins / auth.js
Last active November 12, 2019 23:02
Script to fetch images from Flickr
// 1. Add your API key and secret below
// 2. Run `npm i flickrapi` to install the SDK dependency
// 3. Run 'node auth.js` and follow the instructions
// (will open browser window, need to paste number back in terminal and copy entire output)
const Flickr = require('flickrapi')
const FLICKR_API_KEY = 'YOUR-API-KEY'
const FLICKR_SECRET = 'YOUR-API-SECRET'
Flickr.authenticate({
@iaincollins
iaincollins / UK Bills in the media
Last active July 25, 2019 07:17
Bills before the UK Parliament fetched & tagged and linked with news coverage from across the media using BBC News Labs APIs
Title: Specialist Printing Equipment and Materials (Offences) Bill
Type: Private Members' Bill, 10 Minute Rule Bill
Stage: House of Commons, 2nd reading
Sponsors: Mr David Amess
Documents: 1
Tags: body corporate, United Kingdom, supply Specialist Printing Equipment, related body corporate, attributable neglect
Articles: 0
--------------------
Title: Houses in Multiple Occupation (Energy Performance Certificates and Minimum Energy Efficiency Standards) Bill
Type: Private Members' Bill, Presentation Bill