Skip to content

Instantly share code, notes, and snippets.

View BrooksPatton's full-sized avatar

Brooks Patton BrooksPatton

View GitHub Profile
@BrooksPatton
BrooksPatton / main.rs
Last active August 25, 2023 14:32
Serializing and Deserializing to different shaped objects with Serde
use serde::{Deserialize, Serialize};
fn main() {
let red_ghost_string = r#"
{
"name": "red_gost",
"color": {
"blue": 4,
"green": 9,
"red": 255
@BrooksPatton
BrooksPatton / index.js
Created May 5, 2020 17:39
Calculate the number of days displayed on a calendar month
function daysOnMonthlyCalendar(day) {
const firstDayOfMonth = new Date(day);
firstDayOfMonth.setDate(1);
const lastDayOfMonth = new Date(firstDayOfMonth.getFullYear(), firstDayOfMonth.getMonth() + 1, 0);
const daysOnCalendar = firstDayOfMonth.getDay() + lastDayOfMonth.getDate() + (6 - lastDayOfMonth.getDay());
return daysOnCalendar;
}
@BrooksPatton
BrooksPatton / lib.rs
Created September 6, 2019 12:57
GGEZ basic setup
use ggez::{Context, GameResult, graphics};
use ggez::event::EventHandler;
pub struct Game {
}
impl Game {
pub fn new(_context: &mut Context) -> Game {
Game {
}
@BrooksPatton
BrooksPatton / ld40-chatbot-game-plan.md
Created December 2, 2017 04:49
Chat bot roguelike rpg game

End goal / reason

I want viewers of my channel to have fun and be entertained while watching me code. This relieves me from always talking the entire time as something else can happen while I'm troubleshooting.

Thoughts

  1. Must be optional
  2. Must be within the zpd (zone of promimal development) of the player / viewer
  3. Must have feedback for each players actions
  4. Player must be able to improve
@BrooksPatton
BrooksPatton / ldjam-ideas.md
Created December 2, 2017 03:17
ludum dare jam ideas

The more you have, the worse it is

  • Action RPG where as the character gets more inventory items the enemies become stronger and more dangerous
  • Gun that fires a load of particles that is constantly refilling. If firing too soon, not enough damage, too late and the particles damage the gun
  • Infinite runner, where the speed is increasing which makes it harder to play
  • Breakout where many many balls are added to the screen
  • Collectable card game, where the more cards you have the worse it gets for you
  • Turn based strategy game where the player commands armies and takes land. Never has enough military to defend and attack
  • Reverse platformer where the character needs to put back all of the coins that they got when they first went through the level
  • Idle game where the player is gaining resources, but as they gain them something bad is happening
@BrooksPatton
BrooksPatton / linux-flavors-notes.md
Last active November 15, 2017 14:43
What linux flavors that I have tried, and any notes that I have on them

linux flavor notes

This document will show what linux images that I have tried and any thoughts on them if necessary

Linux distros

Ubuntu 16 LTS

Worked, but had to install a lot of custom PPAs. Prefered using Budgie Desktop

Apply agile principles

Drill

Build a project using Agile principles. This means

  • Creating or using existing user stories
  • Using software like Pivotal Tracker or Trello
  • Rating the difficulty of the stories before you begin
  • Completing one story at a time (story is not done until it works, is styled, and doesn't have any debugging code)
@BrooksPatton
BrooksPatton / flappybirdcloneplan.md
Last active September 18, 2017 22:09
order to create flappy bird with p5js. Made in preparation for a meetup talk

Flappy Bird Clone

directions

Create circle hello world

index.html

main.js

@BrooksPatton
BrooksPatton / intro-to-promises.js
Created August 29, 2017 20:43
Promise basics
// var promise = new Promise(function(resolve, reject) {
// resolve(5);
// })
function waitUntil(num, str) {
var promise = new Promise(function(resolve, reject) {
setTimeout(function() {
resolve(str);
}, num);
});
" GistID: c3d3a6cf592e1b5668658bce61a6a3a5
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')