Skip to content

Instantly share code, notes, and snippets.

View AlabasterAxe's full-sized avatar
🍊
<= Look at this Orange

Matthew Keller AlabasterAxe

🍊
<= Look at this Orange
View GitHub Profile
@AlabasterAxe
AlabasterAxe / Discofever.cpp
Created December 4, 2012 01:57
Super Disco: Infinite Dance
//////////////////////////////////////////////////////////////////////////////////////
// spotlight.cpp
//
// This program draws an array of spheres lit by a spotlight whose cone angle can be
// changed and which can be moved as well. The spotlight cone is shown by a wireframe.
// The spheres are colored using color material mode.
//
// Interaction:
// Press the page up/down keys to increase/decrease the spotlight cone angle.
// Press the arrow keys to move the spotlight.
@AlabasterAxe
AlabasterAxe / .hgrc
Created February 23, 2019 07:51
Mercurial Config
[ui]
username = mattkeller
merge = vimdiff
[extensions]
extdiff=
hgk=
hgext.beautifygraph=
histedit=
@AlabasterAxe
AlabasterAxe / gist:bae62dc453295e3c872d689ec72ce625
Created March 29, 2019 20:35
MathJax Double Buffering Thing
<!DOCTYPE html>
<html>
<head>
<title>MathJax Dynamic Math Test Page with ASCIIMath Input</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML"></script>
<style>
input {margin-top: .7em}
/* Copyright 2015-2017 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@AlabasterAxe
AlabasterAxe / html.json
Last active November 18, 2019 23:40
Angular 8 HTML snippets
{
"Uppercase pipe": {
"prefix": "ng-pipe-uppercase",
"description": "Uppercase pipe",
"body": [
"{{ ${variable} | uppercase }}$0"
]
},
"Lowercase pipe": {
"prefix": "ng-pipe-lowercase",
@AlabasterAxe
AlabasterAxe / sprite.dart
Created November 9, 2020 23:38
The Sprite class for a Flutter implementation of the Google Chrome Dino Game
class Sprite {
String imagePath;
int imageWidth;
int imageHeight;
}
@AlabasterAxe
AlabasterAxe / game-object.dart
Created November 9, 2020 23:44
Game Object Class for Flutter implementation of Chrome Dino Game
abstract class GameObject {
Widget render();
Rect getRect(Size screenSize, double runDistance);
void update(Duration lastTime, Duration elapsedTime) {}
}
@AlabasterAxe
AlabasterAxe / dino.dart
Created November 9, 2020 23:46
Initial Dino GameObject Implementation for Flutter implementation of Google Chrome Dino Game
Sprite dino = Sprite()
// basically a placeholder because we do the sprite animations separately
..imagePath = "dino/dino_1.png"
..imageWidth = 88
..imageHeight = 94;
class Dino extends GameObject {
@override
Widget render() {
@AlabasterAxe
AlabasterAxe / main.dart
Created November 9, 2020 23:48
Partial build Method implementation for Flutter Implementation of Google Chrome Dino Game
Rect dinoRect = dino.getRect(screenSize, 0);
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Stack(
alignment: Alignment.center,
children: [
Positioned(
left: dinoRect.left,
@AlabasterAxe
AlabasterAxe / main.dart
Created November 9, 2020 23:50
initializing the worldController for Flutter implementation of Google Chrome dinosaur game
AnimationController worldController;
@override
void initState() {
super.initState();
worldController =
AnimationController(vsync: this, duration: Duration(days: 99));
}