Skip to content

Instantly share code, notes, and snippets.

@zaun
zaun / Location.schema.json
Last active September 8, 2018 18:51
Schemas for data
{
"id": "Location#",
"title": "Location Schema",
"description": "A location",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "UUID v4 with 'L-' prefix",
"pattern": "/^L-[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/i"
@zaun
zaun / gist:b4ea246ef7036add8ea54a54ffae6f70
Last active October 17, 2017 18:53
Single Player Game Pitch
Galactic Explorer
Hex map, 2d, like Hades Star.
Each system is a star that can have 2 rings of hexes with planets or other stuff in it.
Each hex can have up to 2 planets in it, each star can have up to 10 of the 18 hexes around it with something in it.
Each star is a minimum of 7 hexes from another star.
Each planet can have up to 3 moons.
Basically and endless map to explore.
Grid.hexagonalShape = function(size) {
var hexes = [];
var _g1 = -size;
var _g = size + 1;
while(_g1 < _g) {
var x = _g1++;
var _g3 = -size;
var _g2 = size + 1;
while(_g3 < _g2) {
var y = _g3++;
@zaun
zaun / server_setup_cloudformation.yaml
Created January 26, 2019 04:15
Setup a website on AWS. Creates DNS, S3, API Gateway and a Lambda function.
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Website S3 Hosted, API Gateway Backend
Parameters:
DomainName:
Type: String
Description: The DNS name of an Amazon Route 53 hosted zone e.g. server.com
AllowedPattern: '(?!-)[a-zA-Z0-9-.]{1,63}(?<!-)'
ConstraintDescription: must be a valid DNS zone name.
Mappings:
@zaun
zaun / server_setup_cloudformation.yaml
Created January 26, 2019 04:15
Setup a website on AWS. Creates DNS, S3, API Gateway and a Lambda function.
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Website S3 Hosted, API Gateway Backend
Parameters:
DomainName:
Type: String
Description: The DNS name of an Amazon Route 53 hosted zone e.g. server.com
AllowedPattern: '(?!-)[a-zA-Z0-9-.]{1,63}(?<!-)'
ConstraintDescription: must be a valid DNS zone name.
Mappings:
@zaun
zaun / main.dart
Created July 21, 2019 05:14
Uncomments the code at 61, 106 or 114 will cause the error `MediaQuery.of() called with a context that does not contain a MediaQuery.`
import 'dart:async';
import 'dart:math';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'views/main_view.dart';
import 'views/update_view.dart';
import 'store.dart';
import 'recordKeeper/store.dart';
@zaun
zaun / cpu_mem_interface.sv
Created December 23, 2024 19:25
CPU <--> TileLink-UL interface
`timescale 1ns / 1ps
`default_nettype none
module cpu_mem_interface #(
parameter XLEN = 32, // Bus data width
parameter SLEN = 2, // Source ID length
parameter MAX_RETRIES = 3 // Maximum number of retry attempts
) (
input wire clk,
input wire reset,