Skip to content

Instantly share code, notes, and snippets.

@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 / 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:
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 / 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.
@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 / feedback.md
Last active September 23, 2017 01:17
HACC Feedback

Feedback

Hi, this has been the first year I participated in the HACC and I thought I would give some feedback. But first I think overall HACC is a great idea and it has been mostly a positive experance.

To give a bit of perspective of where this feedback are coming from, I'm a professional software developer and I work 40+ hours a week at my job. My time spent on the hackathon was a few evenings and weekends.

I'm coming at this thinking the state wants viable solutions to issues it currently has, as the primary goal. The state wants help support and educate developers in the community, as a secondary goal. Finally the state wants to help people create a business and monetize their solutions, as a tertiary goal. This is my perspective and my understanding based on being involved in the HACC so far and having friends that were involved last year.

  • Overall there could be a lot of improvements to the HACC, some small, some large.
  • Overall the process could be a lot more productive than it currently i
@zaun
zaun / interrupts.c
Created May 31, 2017 03:40
Context switch on an interrupt vector
void __attribute__((interrupt("IRQ"))) _c_interrupt_vector(void)
{
static int lit = 0;
/* Clear the ARM Timer interrupt - it's the only interrupt we have
enabled, so we want don't have to work out which interrupt source
caused us to interrupt */
RPI_GetArmTimer()->IRQClear = 1;
/* Flip the LED */
@zaun
zaun / player.cs
Last active March 12, 2017 03:07
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
[RequireComponent (typeof (Rigidbody))]
public class Player : LivingEntity {
[Header("Hoover")]
public Transform[] hooverPoints;
@zaun
zaun / Bullet.cs
Created February 28, 2017 04:47
Unity3d Smart Object Pooling
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Bullet : PoolObject {
Rigidbody myRigidbody;
public override void OnAwake() {
if (myRigidbody == null) {
myRigidbody = GetComponent<Rigidbody> ();