Skip to content

Instantly share code, notes, and snippets.

View tsmarsh's full-sized avatar

Tom Marsh tsmarsh

  • Tailored Shapes
  • Scituate, MA
View GitHub Profile
Compiled from "App.java"
public class org.example.App {
static java.util.Random rando;
public org.example.App();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
@tsmarsh
tsmarsh / hello.txt
Created February 13, 2024 20:06
Test
Hello, World!
package com.tailoredshapes.hexoflife;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import static com.tailoredshapes.underbar.ocho.UnderBar.*;
@tsmarsh
tsmarsh / StreamGame.java
Created October 24, 2023 19:38
Comparison of Java Streams and Underbar
package com.tailoredshapes.hexoflife;
import java.util.*;
import java.util.stream.Collectors;
public class Game {
public boolean isAlive(Set<HexCoordinate> world, HexCoordinate coord) {
return world.contains(coord);
}
[dependencies]
actix-web = "4.0.0-beta.8"
actix-rt = "2.2.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sqlite = "0.26.0"
tokio = { version = "1", features = ["full"] }
@tsmarsh
tsmarsh / example_type.js
Created August 4, 2022 18:07
How I do graph ql traversal
class User {
constructor(data, queryName, account_link_url, bank_account_url) {
this._queryName = queryName;
this._account_link_url = account_link_url;
this._bank_account_url = bank_account_url;
this.object_id = data.object_id
this.firstName = data.firstName
this.lastName = data.lastName
this.displayName = data.displayName
@tsmarsh
tsmarsh / gol.rs
Created March 15, 2021 01:28
First pass at Game of Life
mod gol {
use std::collections::{HashMap, HashSet};
use std::hash::{Hash};
use ndarray::{arr2, Array2};
use std::fmt::{Display, Formatter, Result};
#[derive(Hash, PartialEq, Eq, Debug, Copy, Clone)]
pub struct Coordinate {
pub x: i32,
pub y: i32,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
rm -Rf /
@tsmarsh
tsmarsh / gol.feature
Created January 1, 2019 17:08
Features for Game of Life
Feature: Main game
Any live cell with fewer than two live neighbors dies, as if by under population.
Any live cell with two or three live neighbors lives on to the next generation.
Any live cell with more than three live neighbors dies, as if by overpopulation.
Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
Scenario: A cell starts dead
Given we have a game:
"""
0,0,0