Skip to content

Instantly share code, notes, and snippets.

@agmcleod
agmcleod / .eslintrc
Last active August 29, 2015 14:26
React/JSX/ES6 setup.
{
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": false,
"classes": true,
"forOf": true,
"jsx": true,
"modules": true,
"objectLiteralShorthandMethods": true
},
@agmcleod
agmcleod / melonjs-ecs.md
Last active April 10, 2017 02:14
MelonJS ECS Proposal

Melonjs ECS proposal

After working with unity a fair bit, I've come to appreciate the modular code base. Components have an expected api, and provide a single thing to the parent object or entity.

The problems with the current setup.

  • It can be hard to know what objects you need. Renderable/Sprite/Animation Sheet
  • Entity is the only thing that has physics, defaults to an animation sheet.
  • Sprite is the only thing that provides scale and rotation, plus subclasses
extern crate rand;
use std::cmp;
use std::collections::HashMap;
use rand::distributions::{IndependentSample, Range};
#[derive(Debug)]
struct Boss {
hp: i32,
damage: i32
@agmcleod
agmcleod / application.js
Created April 24, 2016 21:45
React on rails configs
// DO NOT REQUIRE jQuery or jQuery-ujs in this file!
// DO NOT REQUIRE TREE!
// CRITICAL that vendor-bundle must be BEFORE bootstrap-sprockets and turbolinks
// since it is exposing jQuery and jQuery-ujs
//= require vendor-bundle
//= require server-bundle
//= require turbolinks

Podcasts and why

  • Back to Work - Life style podcast. Dan benjamin & Merlin Mann. DB is owner of 5by5 podcast network. He and merlin chat about productivity, work flows, life and work balance, past experiences, nerdy things.
  • Quit - Dan benjamin & Haddie cook. Dan & his employee Haddie answer listener emails about jobs, quitting, hiring, doing your own thing. A bit more infrequent of a podcast
  • Road work - Life style podcast. Dan benjamin & John Roderick. They talk about all sorts of life experiences. Drugs, food, travel, music.
  • Accidental Tech Podcast - Marco Arment, John Siracusa, Casey Liss. Three programmers working in different facets of the industry talk a lot about Apple tech, but other things of interest as well. Occasionally about cars & tesla as well.
  • Reconcilable differences - Life style podcast. Merlin Mann & John Siracusa talk about how they got the way they are.
  • Lostcast - Podcast between two gamedevs as they work on their new game. Talk about design, developme
@agmcleod
agmcleod / webgl-gallery-steps.js
Last active July 7, 2016 00:11
webgl gallery steps
@agmcleod
agmcleod / state.rs
Created June 30, 2018 14:31
State management rust, snippet
pub mod play_state;
use std::sync::{Arc, Mutex};
use specs::World;
use std::collections::HashMap;
use scene::Node;
use conrod::backend::gfx::Renderer;
@agmcleod
agmcleod / App.css
Created November 22, 2019 21:02
This can be tested via create react app.
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
}
.App-header {
background-color: #282c34;
{
"openapi" : "3.0.0",
"info" : {
"title" : "Simple Inventory API",
"description" : "This is a simple API",
"contact" : {
"email" : "you@your-company.com"
},
"license" : {
"name" : "Apache 2.0",
use debug_gfx::draw_nav_mesh;
use std::fs::File;
use std::io::prelude::*;
use std::io::Result;
mod debug_gfx;
fn read_file(path: &str) -> Result<String> {
let mut text = String::new();
let mut file = File::open(path)?;